By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,395 Members | 2,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

Exception when using delayload linker option in release build

P: n/a
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?

Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"HairlipDog58" <Ha********@nospam.nospam> wrote in message
news:8F**********************************@microsof t.com...
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
Nov 17 '05 #2

P: n/a
HairlipDog58 wrote:
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?

--
Doug Harrison
Microsoft MVP - Visual C++
Nov 17 '05 #3

P: n/a
Thank you both very much, that seems to have solved the problem.
Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.