Exception in C Library from .Net built VC++ Application

G

Guest

We have a strange error here.
We have an application that is built in VC++ 6.0 and uses a C library built
using the same. Now, we have migrated to .Net and have used the same source
code to be built using the new compiler.
What happens now is, that any call that we make to the C library(also built
in .Net Env now) from the VC++ Application(built in .Net now), falls prey to
a runtime exception and gets into our try catch block.
We are having hard time to get this guy out.
Any help will be appreciated.
Regards
Venky
 
D

David Levine

Perhaps if you supplied some details about the exception and the library
someone could provide some help.
 
G

Guest

Hi David,
Thanks for your response. Unfortunately its our own C library and as on date
I cannot reveal that for corporate rules.
However, I can give you more information.
Firstly, there is no specific exception code related to this.
Guess what if I have the same library built using VC++ 6.0 it works OK, but
when I build it with .Net it crashes.
Any clues?
Thanks
Venky
 
D

David Levine

All you have told us is that something doesn't work without supplying any
details at all, not even what the exception is. What do you expect anyone to
do?
 
D

DM McGowan II

Are you using a catch(...), just curious?

Are you calling WIN32 GetLastError()?

Are you getting it while in a debug session? If not try. If you can't then
collecting runtime information about the call stack.

There are many things you 'could' do as Mr. Levine pointed out.
 
D

David Levine

This only happens with a release build?

This sounds like a typical, difficult-to-debug unmanaged code problem. One
approach you can try is to compile the release build with debugging symbols
and load it up in a debugger. Set the debugger to break on 1st chance
exceptions. If an exception is actually getting thrown in the C++ code it
should break there. It may also be that the runtime is converting a return
value into an exception. There are a thousand possibilities, but without
more details it is impossible to say.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top