Question

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).

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top