Exception when using delayload linker option in release build

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
HairlipDog58 said:
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?

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
 
HairlipDog58 said:
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?

Have you tried changing the exception-handling compiler option for the file
from /GX (implies /EHsc) to /EHa?
 
Back
Top