Вопрос

In my program i really need to use SEH exception handlers, which catch errors like AccessViolation & etc., but handlers work only in Debug build.

I have enabled same option in Release build, but it does not work.

How to enable SEH in Release mode ANYWAY?

Thank you!

__try { /* crash code */ }
__except(EXCEPTION_EXECUTE_HANDLER { MessageBox("Crash prevented"); }

Works in Debug build mode, but not in Release (crashes).

Это было полезно?

Решение

After playing with settings more i have found the solution. In Release config i had to activate "Basic Run-time checks" in page "Code generation" to enable SEH exception handlers.

"Basic Run-time checks" option cannot be used with any optimization enabled.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top