"William DePalo [MVP VC++]" wrote:
Are you translating structured exceptions to C++ "typed" exceptions with
_set_se_translator()? If so, what is probably happening is that the compiler
sees no way that the C++ code could throw an exception so it just goes ahead
and removes the try / catch stuff.
If that's your problem you can "fix" it by compiling with the /EHa switch.
There is quite a lot to say on this subject and Doug does it best here:
http://members.cox.net/doug_web/eh.htm
Regards,
Will
Thanks for the reply, William,
I have tried the /Eha switch and still got the same problem.
I did not use the _set_se_translotr() , instead, using the assemly code to
directly replacing _EXCEPTION_REGISTRATION structure. It is a method
described in the Matt Pietrek's article and is commonly seen and used on the
net.
However, I still think it's a compiler related issue, as the method would
work fine with VC6 compilation (both Debug and Release) and not in VC 2005
(only Debug mode works)
P.S.
You can find Matt Pietrek's article here:
http://www.microsoft.com/msj/0197/Ex...Exception.aspx
Any more ideas?
Thanks again,
Johnny