I want to use exceptions in my program. But my program have custom entrypoint and does not use CRT (C-runtime).
My program is simple as this:
MessageBox(NULL, L"exception will be thrown", L"ok", MB_ICONEXCLAMATION | MB_OK); try { throw 123; } catch (...) { MessageBox(NULL, L"exception thrown", L"ok", MB_ICONEXCLAMATION | MB_OK); }
All works fine when I use standard entrypoint and CRT. But when I change EP of the program, it will crash with error 'Access violation' while calling function _CxxThrowException.
I've made a detailed screenshot of the crash: http://vs712.server4u.cz/exception.png
What is causing this error? Is there a workaround how to use exceptions without using CRT?
Thanks.