Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

SetUnhandledExceptionFilter

bool g_showCrashDialog = false;

LONG WINAPI OurCrashHandler(EXCEPTION_POINTERS * ExceptionInfo)
{
    std::cout << "Gotcha!" << std::endl;

    return g_showCrashDialog ? EXCEPTION_CONTINUE_SEARCH : EXCEPTION_EXECUTE_HANDLER;
}
int main()
{
    ::SetUnhandledExceptionFilter(OurCrashHandler);

    std::cout << "Normal null pointer crash" << std::endl;

    char *p = 0;
    *p = 5;
}
Source by www.codeproject.com #
 
PREVIOUS NEXT
Tagged: #SetUnhandledExceptionFilter
ADD COMMENT
Topic
Name
7+5 =