If you can change the source, the interrupt behavior (called assert) must be changed to abort the abort / retry / ignore dialog.
In case of interruption, crashdump will be created by default (by default), so you wonβt lose what is important.
In addition, you can configure assert behavior to write only to stderr. This is NOT required if the interrupt behavior is sufficient for what you want. Note: _Crtxxx calls are active only in debug builds (/ Zi).
Minimum change to disable the abort / retry / ignore function. Break the _Crt calls and enable crtdbg.h to also change the behavior of assert in the debug mode lines.
#include <stdlib.h> //#include <crtdbg.h> int main(int argc,char **argv); int main(int argc,char **argv) { // ON assert, write to stderr. //_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); //_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR ); // Suppress the abort message _set_abort_behavior( 0, _WRITE_ABORT_MSG); abort(); return 0; }
msdn assert mode
rickfoosusa
source share