Guest_imported
New member
- Jan 1, 1970
- 0
I am making a console app with VC6.0 enterprise edition.
I use _CrtCheckMemory at various points to check the memory heap for corruption. Basically, if this function finds an error, I want the program to allow me to debug it. So I followed the _CrtCheckMemort test with an assert(0) statement, the idea being that the assertion will prompt me for debugging.
However, in order to get the output of _CrtCheckMemory to go into the debug window, I need to use _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG ); But when I have this selected, assert changes also: it stops prompting me for the debugger and just terminates the program with a message.
Why does this happen, and how can I get both _CrtCheckMemory to go to the debug window -and- get the program to halt execution so that I can debug it?
I use _CrtCheckMemory at various points to check the memory heap for corruption. Basically, if this function finds an error, I want the program to allow me to debug it. So I followed the _CrtCheckMemort test with an assert(0) statement, the idea being that the assertion will prompt me for debugging.
However, in order to get the output of _CrtCheckMemory to go into the debug window, I need to use _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG ); But when I have this selected, assert changes also: it stops prompting me for the debugger and just terminates the program with a message.
Why does this happen, and how can I get both _CrtCheckMemory to go to the debug window -and- get the program to halt execution so that I can debug it?