How to debug application using SetUnhandledExceptionFilter function for exception handling



 DEVELOP > c-Plus-Plus > How to debug application using SetUnhandledExceptionFilter function for exception handling

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Raghunatha Babu"
Date: 05 Apr 2005 06:35:00 AM
Object: How to debug application using SetUnhandledExceptionFilter function for exception handling
Hi
We are using the API "SetUnhandledExceptionFilter" to handle the exceptions
globally as:
SetUnhandledExceptionFilter(MyUnHandleExceptionFilter);
where the prototype of "MyUnHandleExceptionFilter" is:
LONG WINAPI MyUnHandleExceptionFilter(struct _EXCEPTION_POINTERS
*lpExceptionInfo);
This works fine while running in Debug and Release modes. But while
debugging, it is not handling the exceptions. In MSDN It is mentioned that
this function doesn't support the Debugging.
Ex:
void TestIntegerDivideByZero(int x, int y)
{
try
{
int ix = 0;
int nVal = 0;
int ix = 5 / nVal; //It is not possible to proceed from this statement
while debugging.
_tprintf(_T("Integer By Zero - Result = %d\n"), ix);
++ix;
}
catch (OSException& exception)
{
_tprintf(_T("<Thread - %x> - Exception Code = %x\n"),
GetCurrentThreadId(), exception.getExceptionCode());
}
}
We already know that the SetUnhandledExceptionFilter doesn't handle
exceptions while debugging, because the debugger will catch the exceptions
while debugging. This functionality is implemented in dll and used in other
exe's. To debug other exe's this functionality should not make any
difficulties.
Can any one please let us know how to handle the exceptions while debugging
?
Are there any other APIs with which we can combine the
SetUnhandledExceptionFilter and solve the purpose??
Regards,
Raghunath.
.

User: "Phlip"

Title: Re: How to debug application using SetUnhandledExceptionFilter function for exception handling 05 Apr 2005 09:09:22 AM
Raghunatha Babu wrote:

We are using the API "SetUnhandledExceptionFilter" to handle the

exceptions

globally as:

Please use http://groups.google.com to search for the best newsgroup for
SetUnhandledExceptionFilter(). This group tries to discuss raw C++.
Also, you might accidentally find the answer...
--
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER