[Qt-interest] Catching terminal exceptions

Info info at misafe.com
Sun Nov 15 20:35:13 CET 2009


Hi,

I'm trying to implement a global exception handler to allow me to  
generate a crash report and forward the information on to enable us to  
fix the problem.

In main(), I have tried both:

try {
	RunApplication();
} catch(...)
{
	HandleException();
}

And:

__try {
	RunApplication();
} __except(exhandler(GetExceptionCode(), GetExceptionInformation()) {
	// exhandler handles the exception
}

The latter requires that I put the code within a separate function to  
allow the stack unwind to happen even when an exception occurs. Both  
of these methods still result in a "encountered a problem...Tell  
Microsoft" dialog. What is the correct way to handle a global  
exception and prevent the standard Windows dialog appearing?

I'm compiling with /EHsc but I have also tried with /EHa without  
success.

Thanks.



More information about the Qt-interest-old mailing list