void ProgError( char *errstr, ...) { TRACE ("ProgError: start"); static char msg[256]; // Safer than on stack va_list args; Beep(); Beep(); va_start(args, errstr); vsprintf(msg, errstr, args); if (Debug == TRUE && logfile != NULL) { fprintf( logfile, "\nProgram Error: *** "); vfprintf( logfile, errstr, args); fprintf( logfile, " ***\n"); } va_end( args); ::MessageBox (0, msg, "WinDEU error", MB_OK | MB_ICONSTOP | MB_TASKMODAL); // clean up things CleanupWindeu(); // Exit immediately TRACE ("ProgError: exit(5)"); exit (5); }
// // Called at exit // void _USERENTRY CleanupApp() { if ( hKeyboardHook != NULL ) UnhookWindowsHookEx (hKeyboardHook); CleanupWindeu(); }