Jump to content
  • Advertisement
Sign in to follow this  
emmai

SEH...strange?

This topic is 5051 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
Advertisement
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
How are they different? What are their values?

you can compile/link the code and then run to get the result~

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!