Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Mon, 25 Aug 2008 07:56:46 -0700 (PDT),    group: microsoft.public.platformsdk.base        back       


Portable way to have C++ exceptions escape __except   
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
date: Mon, 25 Aug 2008 07:56:46 -0700 (PDT)   author:   Paul Carter

Re: Portable way to have C++ exceptions escape __except   
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
date: Thu, 28 Aug 2008 14:45:44 -0500   author:   Ben Voigt [C++ MVP] am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us