I could do some tests, and I can only confirm that registering the SIGABRT signal handler is just NOOP.
I tried this with a very simple graphical interface written using VS2008 Express.
- no framework, not .NET, but only Win API
- one menu with Exit and Fatal
- menu driven directly in WndProc
- Fatal execute 1/0
Here is the result:
- no special action => windows open a MessageBox indicating a fatal error ...
- signal handler for SIGABRT => same MessageBox
- C ++ try catch (...) => same MessageBox
- SEH in WndProc: may catch the error!
- SEH around the message loop: may catch the error!
If I put SEH bot handlers, then most internal (WndProc) catches.
Itβs good for you that if this is enough to protect the message outline, and you donβt have to enter every WndProc.
The bad newbie is that I don't know the C ++ constructor and cannot tell where to find the message loop.
To give you the key, here is how I can protect the message loop in a WinAPI application:
__try { while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } } __except (EXCEPTION_EXECUTE_HANDLER){ ::MessageBox(NULL, _T("FATAL"), _T("MAIN"), MB_OK | MB_ICONERROR); }
This way I can see my own message box, but nothing else, and if I comment on my message box, the application will quit quietly.
But ... since the message you are showing is not original Windows, I suspect that the C ++ creator already has such an exception handler in its message loop.
Hope this helps ...
source share