I have a dll that throws an exception like:
throw POMException(err, drvErr, errmsg);
The calling code is in a separate program and has a try, catch block like this:
try { // function in separate DLL } catch (TXNPDO_Exception& e) { SR_PERFLOG_MSG(SR_PERFMASK_SELECT, "ERROR selectInStages"); TXNDBO_THROW(e); }
Where TXNPDO_Exception
defined in the included file:
#define TXNPDO_Exception POMException
When running this, the debugger indicates that a POMException
was unhandled. I even added a catch(...)
clause and it is still not being processed.
I suspect that this has something to do with Visual C ++ compilation options, because the DLL under consideration is an outdated library that is compiled separately from the program that calls it. I am using Visual Studio 2003.
The cpp DLL files are compiled with the following (corresponding) flags: /X /GR /Ob1 /Zi /GX /Od /MDd /LD
. Other exceptions in the calling program are handled correctly.
Can someone explain the reasons why this exception does not apply to the calling program?
Edit:
The DLL was previously compiled with a possible build environment and code changes that are not available to me. A previously compiled library correctly extends to exceptions.
I compile the client program using the same compiler, using basically the same keys: -Od -W3 -Z7 -MDd -GX -GR -Zm800
(no /X
or /Ob1
and /Z7
instead of /Zi
).
source share