Structured Exception handling in Qt
-
wrote on 27 Feb 2018, 10:24 last edited by
Hi! I want to write some
Structured Exception
handling in the application to collect user feedback/or free resources safely.__try { // some test code } __except (EXCEPTION_EXECUTE_HANDLER) { qDebug() << "Exception"; }
It's working in
Visual Studio
, but inQt
I get the following error:error: C2712: Cannot use __try in functions that require object unwinding
Any ideas how to fix it? Thanks.
-
Use standard
try
andcatch
. -
Hi! I want to write some
Structured Exception
handling in the application to collect user feedback/or free resources safely.__try { // some test code } __except (EXCEPTION_EXECUTE_HANDLER) { qDebug() << "Exception"; }
It's working in
Visual Studio
, but inQt
I get the following error:error: C2712: Cannot use __try in functions that require object unwinding
Any ideas how to fix it? Thanks.
@Cobra91151 It sin't related to Qt, Qt is a framework not a compiler.
See here https://msdn.microsoft.com/en-us/library/xwtb73ad.aspx -
wrote on 27 Feb 2018, 11:37 last edited by
But
try
andcatch
only handles the C++ exceptions notStructured Exception
. -
@Cobra91151 It sin't related to Qt, Qt is a framework not a compiler.
See here https://msdn.microsoft.com/en-us/library/xwtb73ad.aspxwrote on 27 Feb 2018, 11:38 last edited byOk. I will check it. Thanks.
1/5