• Advertisement
Sign in to follow this  

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

This topic is 2850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
Sign in to follow this  

  • Advertisement