R
Raghunatha Babu
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.
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.