I have a VC++6 project where I need to delay load a DLL. I used a structured
exception handling frame and all seems to work when I build the debug version
and run it (either in or out of the debugger). In debug build, the exception
is caught and reported gracefully to the user. When I build the release
version and run it, the SEH frame does not catch the exception and the
application crashes.
Has anyone had a similar experience and if so, what is the resolution?
William DePalo [MVP VC++] - 28 Jan 2005 17:20 GMT
>I have a VC++6 project where I need to delay load a DLL. I used a
>structured
[quoted text clipped - 7 lines]
>
> Has anyone had a similar experience and if so, what is the resolution?
This is a guess. Try rebuilding with the /EHa switch.
If it does not fix the problem, as Emily Litella used to say "nevermind".
If it does it is because the Release build optimizes away your exception
handling. That can happen when it doesn't see a way in which an exception
can be thrown. Realize that the compiler has limited information when it
does this - it does not know about structured exceptions, it only knows
about C++ exceptions.
Regards,
Will
Doug Harrison [MVP] - 28 Jan 2005 17:25 GMT
>I have a VC++6 project where I need to delay load a DLL. I used a structured
>exception handling frame and all seems to work when I build the debug version
[quoted text clipped - 4 lines]
>
>Has anyone had a similar experience and if so, what is the resolution?
Have you tried changing the exception-handling compiler option for the file
from /GX (implies /EHsc) to /EHa?

Signature
Doug Harrison
Microsoft MVP - Visual C++
HairlipDog58 - 31 Jan 2005 18:17 GMT
Thank you both very much, that seems to have solved the problem.