Sign in to follow this  
Fireborn

Access Violation when calling into 3rd party C++ library from C# executable

Recommended Posts

Fireborn    122
Hey all, I'm integrating a 3rd party library into an existing application. The executable itself is written in C#, and there is a C++/CLI wrapper used to call various native C++ libraries. I have a 3rd party library which, after integration, has caused several access violation issues. I initially couldn't even get the assembly to load after integration (the C# app would crash when attempting to load the C++/CLI dll). I worked around this by wrapping the 3rd party library in it's own .dll, and programmatically loading it once I was past the C++/CLI layer in an entirely native C++ library. Now that I'm able to execute code within the library, it is causing access violations inside various API function calls. I guess I'm trying to understand the nature of the problem, and if it is something I can even really fix on my own given that I don't have access to the source for this library. In general, I understand what it means when you hit an access violation, however I'm concerned that the real error, down in the C++ libraries, is getting masked by a generic .net exception type due to the CLI layer (although, I thought I would see SEHException if that was the case). Does anyone have any advice on how to tackle this sort of issue, or if it's a lost cause without working with the 3rd party library developer?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this