Re: Exception handling from a dll
<paulodonohoe@yahoo.com> wrote in message
news:1179329957.878015.285770@y80g2000hsf.googlegroups.com...
I am calling into a dll from a simple driver. the dll has a number of
exported function (extern "C")
I have enabled the compiler switch /EHs to assume that extern C
functions can throw an exception. If I raise an exception in the dll
the exception is never caught by the drivers catch handler
You need /EHa to catch arbitrary exceptions from extern "C" functions and
hardware exceptions. /EHs enables only C++ exception handling, assuming
that extern "C" functions do *NOT* throw.
So from the driver :
try
{
// call into the dll
LibraryFunctionCall();
}
catch(...)
{
...
}
the LibraryFunctionCall simply generates a throw 1 but it never gets
caught by the driver, instead generates a
"First-chance exception at 0x7c812a5b in clientDriver.exe: Microsoft C+
+ exception: int at memory location 0x0012feb0.."
From the Microsoft MSDN it seems that this should be possible.
Thanks for your help.