Enabling C++ Exceptions in ATL DLL 
Author Message
 Enabling C++ Exceptions in ATL DLL

I am writing a wrapper for a plain old C++ static lib, so that it can
be used in VB.  The lib uses exceptions, but the ATL COM wrapper DLL
project (generated by the VC6 Wizard) starts out with exceptions
turned off.  This produces a lot of warnings in the wrapper code
relating to objects that won't properly unwind if exceptions are
thrown.

Simply turning the exception switch on fixed the problem.

Is this safe?

Cheers
SB



Sun, 20 Jun 2004 13:16:29 GMT  
 Enabling C++ Exceptions in ATL DLL
It is not safe to throw exceptions across COM boundaries (i.e. from COM
server to client).  Otherwise this should beOK.


Quote:
> I am writing a wrapper for a plain old C++ static lib, so that it can
> be used in VB.  The lib uses exceptions, but the ATL COM wrapper DLL
> project (generated by the VC6 Wizard) starts out with exceptions
> turned off.  This produces a lot of warnings in the wrapper code
> relating to objects that won't properly unwind if exceptions are
> thrown.

> Simply turning the exception switch on fixed the problem.

> Is this safe?

> Cheers
> SB



Sun, 20 Jun 2004 20:43:37 GMT  
 Enabling C++ Exceptions in ATL DLL
Also, remove the _ATL_MIN_CRT symbol from your release builds.
That will bite you later...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> It is not safe to throw exceptions across COM boundaries (i.e. from COM
> server to client).  Otherwise this should beOK.



> > I am writing a wrapper for a plain old C++ static lib, so that it can
> > be used in VB.  The lib uses exceptions, but the ATL COM wrapper DLL
> > project (generated by the VC6 Wizard) starts out with exceptions
> > turned off.  This produces a lot of warnings in the wrapper code
> > relating to objects that won't properly unwind if exceptions are
> > thrown.

> > Simply turning the exception switch on fixed the problem.

> > Is this safe?

> > Cheers
> > SB



Mon, 21 Jun 2004 04:35:08 GMT  
 Enabling C++ Exceptions in ATL DLL

Quote:

> Also, remove the _ATL_MIN_CRT symbol from your release builds.
> That will bite you later...

Is this a known issue with exceptions? I was already wondering why
I had to do that.

cu bart

--
http://www.irule.be/bvh/be/politics



Mon, 21 Jun 2004 20:15:37 GMT  
 Enabling C++ Exceptions in ATL DLL
Exception support requires run-time library. _ATL_MIN_CRT configures the
project not to link to runtime library.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:

> > Also, remove the _ATL_MIN_CRT symbol from your release builds.
> > That will bite you later...

> Is this a known issue with exceptions? I was already wondering why
> I had to do that.

> cu bart

> --
> http://www.irule.be/bvh/be/politics



Tue, 22 Jun 2004 01:28:51 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Enable C++ exception?

2. How to enable C++ style Exception Handling

3. basic que abt pure C++ COM Dll and ATL dll

4. Handling ADO exception in ATL dll

5. ATL COM DLL :: DllRegisterserver throw exception 0x80029c4a

6. Throwing exceptions in ATL dll with optimize for SPEED causes Access Violation

7. Exception fired during DLL unload in ATL com object

8. SEH vs C++ Exception handling for an ATL project

9. C++ calling VB Dll Unhandled exception ...

10. Enabling Exception handling causes Linker error, help!

11. Translate a SEH exception into a C++ exception

12. Catching hardware exceptions using C++ exceptions

 

 
Powered by phpBB® Forum Software