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