By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,851 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,851 IT Pros & Developers. It's quick & easy.

How to debug application using SetUnhandledExceptionFilter function for exception handling

P: n/a
Hi

We are using the API "SetUnhandledExceptionFilter" to handle the exceptions
globally as:

SetUnhandledExceptionFilter(MyUnHandleExceptionFil ter);

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.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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/bi...UserInterfaces
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.