470,870 Members | 1,452 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

Launching exceptions from inside a dll

Hi to everyone,
I'm working on a project done in c++ with visual studio.NET 2003. It
involves a main application and a dll. The idea is to create a dll that
exports some classes. The constructors of these classes must be able to throw
exceptions that should be caught in the main application. The exceptions
thrown are CfileExceptions and COleExceptions.

More or less the process in the main application is:
call to exported class constructor
perform required instructions

I've tried the dll with some applications and sometimes it works apparently
well but others a "_CrtIsValidHeapPointer" error occurs. First I thought it
could be due to compilation options.

I've read that "Catching exception types derived from an interface is not
supported under /clr. Also, the common language runtime does not permit you
to catch stack overflow exceptions; a stack overflow exception will terminate
the process".

But I've tried also modifying compiler options in an application that works
well and desptite of the /clr it still works.

Another suspicious point is that the exception is created inside the dll but
later it is deleted in the main application. Anyway, I can't figure out any
other way to do it

I'm quite a beginner in programming so any help will be appreciated.
Apr 5 '06 #1
0 928

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by David Turner | last post: by
26 posts views Thread by OvErboRed | last post: by
6 posts views Thread by Nick Reeves | last post: by
6 posts views Thread by sebastien | last post: by
reply views Thread by Scott Zabolotzky | last post: by
9 posts views Thread by BLiTZWiNG | last post: by
1 post views Thread by Anonieko | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.