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

Launching exceptions from inside a dll

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.