Sign in to follow this  

SEH...strange?

This topic is 4745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include <crtdbg.h>
#include "windows.h"

#define ASSERT(x) if(!(x)){__asm int 3}

LONG WINAPI UnhandledExceptionFilter1(PEXCEPTION_POINTERS pExceptionInfo )
{
return 0;
}
LONG WINAPI UnhandledExceptionFilter2(PEXCEPTION_POINTERS pExceptionInfo )
{
return 0;
}
int main()
{
LPTOP_LEVEL_EXCEPTION_FILTER previousFilter = SetUnhandledExceptionFilter(UnhandledExceptionFilter1);
//	MessageBox(0,0,0,0);
LPTOP_LEVEL_EXCEPTION_FILTER previousFilter1 = SetUnhandledExceptionFilter(UnhandledExceptionFilter2);
ASSERT(UnhandledExceptionFilter1 == previousFilter1);

return 0;
}


as MSDN says,SetUnhandledExceptionFilter returns the previous Unhandled Exception Filter,so in the code,ASSERT is ok! but when I uncomment the "MessageBox(0,0,0,0,)",ASSERT failed... can anyone tell me why??? [Edited by - emmai on December 19, 2004 7:18:05 PM]

Share this post


Link to post
Share on other sites
I add these codes:

char str[256];
sprintf(str,"%p",UnhandledExceptionFilter1);
OutputDebugString(str);
sprintf(str,"%p",previousFilter1);
OutputDebugString(str);

but,UnhandledExceptionFilter1 and previousFilter1 is still different;

help! best regards!

Share this post


Link to post
Share on other sites
Quote:
Original post by LessBread
The code works for me. UnhandledExceptionFilter1 == previousFilter1.

uncomment the line "MessageBox(0,0,0,0);",and try again?

[Edited by - emmai on December 19, 2004 7:47:45 PM]

Share this post


Link to post
Share on other sites

This topic is 4745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this