Application Error popup
-
Hello, Our application produces sometimes popup windows like this application.exe - Application Error The instruction at "0x4003e98c" referenced memory at "0x00000224". The memory could not be "read". or access violation and other things are reported. Our applikation is a console application and we don't want the popup because we can't restart the application automatically before the popup window button is clicked. Is there a similar way like '_set_error_mode' in the VC runtime library. With this function you can put VC runtime library error (i.e. asserts) into a Message Box or to stderr. Frank
-
Hello, Our application produces sometimes popup windows like this application.exe - Application Error The instruction at "0x4003e98c" referenced memory at "0x00000224". The memory could not be "read". or access violation and other things are reported. Our applikation is a console application and we don't want the popup because we can't restart the application automatically before the popup window button is clicked. Is there a similar way like '_set_error_mode' in the VC runtime library. With this function you can put VC runtime library error (i.e. asserts) into a Message Box or to stderr. Frank
Use the __try/__except statements, it's more flexible this way. Here's a sample from MSDN:
// exceptions_try_except_Statement.cpp
// compile with: /EHsc
// Example of try-except and try-finally statements
#include "stdio.h"void main()
{
int* p = 0x00000000; // pointer to NULL
puts("hello");
__try{
puts("in try");
__try{
puts("in try");
*p = 13; // causes an access violation exception;
}__finally{
puts("in finally");
}
}__except(puts("in filter"), 1){
puts("in except");
}
puts("world");
}I see dumb people