Try, catch or miss?
I'm porting my applications from VC++ 6.0 to VC++ 2K5. Vista and VC++ 6.0 are not the best friends. I just finished porting Fping, where I had some linking problems cause I overloaded the printf() function. In the end, I simply renamed the function and each call to printf(). Next on my list was a simple MFC GUI application: the crash test application that comes with Watchdog – O – Matic.
The intent of this program is to generate first chance and second chance exceptions. To generate a first chance exception I have this code:
Everything works fine when compiled with VC++ 6.0. The exception is handled. But when I compile this with VC++ 2K5, the exception isn't handled, and I have a second chance exception (a crash). Vista displays a dialog box, and Watchdog – O – Matic detects a crash instead of a first chance exception. I'm still looking for a solution. Hope there aren't many of these problems when converting...
The intent of this program is to generate first chance and second chance exceptions. To generate a first chance exception I have this code:
CDialog* pDialog = NULL;
try
{
pDialog->Detach();
}
catch(CException* e)
{
e->Delete();
}
catch(...)
{
}
Everything works fine when compiled with VC++ 6.0. The exception is handled. But when I compile this with VC++ 2K5, the exception isn't handled, and I have a second chance exception (a crash). Vista displays a dialog box, and Watchdog – O – Matic detects a crash instead of a first chance exception. I'm still looking for a solution. Hope there aren't many of these problems when converting...

0 Comments:
Post a Comment
<< Home