Hi, I have a program where normal C++ exceptions are getting caught by the structured exception catching mechanism (__except). Doing some research, I was able to determine that the exception code for a C++ exception is 0xE06D7363. And I was able to let my C++ exceptions escape by using: __except( GetExceptionCode() != 0xE06D7363 ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { ... } Is this the *right* way to do this? Is there a MACRO constant to use instead of the magic number 0xE06D7363? I searched all the headers in the platform SDK for it (and its decimal value) without any luck. Thanks in advance, Paul Carter
Paul Carter wrote: > Hi, > > I have a program where normal C++ exceptions are getting caught by the > structured exception catching mechanism (__except). Doing some > research, I was able to determine that the exception code for a C++ > exception is 0xE06D7363. And I was able to let my C++ exceptions > escape by using: > > __except( GetExceptionCode() != 0xE06D7363 ? > EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { > ... > } > > Is this the *right* way to do this? Is there a MACRO constant to use > instead of the magic number 0xE06D7363? I searched all the headers in > the platform SDK for it (and its decimal value) without any luck. I'd suggest that you should let most exceptions escape, and only trap the ones you recognize (divide-by-zero, or access violation, etc.). You may want to put the bulk of your handler logic inside the exception filter, you do this by calling a helper function: __try { ... } __except(LogException(GetExceptionCode())) {} > > Thanks in advance, > > Paul Carter