Structured Exception handling in Qt
-
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 -
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.aspxOk. I will check it. Thanks.