开发者

C++ app fails to initialize (0xc0000005), when using C# dll

开发者 https://www.devze.com 2022-12-23 17:04 出处:网络
I have a C# DLL, which I call from a native C++ programm. As I use Qt and /clr compiler option did not work I followed this tutorial for a bridge.

I have a C# DLL, which I call from a native C++ programm. As I use Qt and /clr compiler option did not work I followed this tutorial for a bridge.

So I have a VS2008 project (compiled with /clr), which 开发者_如何学编程links to the C# DLL and contains the bridge class and the native class, which exposes interfaces to my C++ programm. Another VS2008 project (no .net stuff) calls the native class (statically linked).

I had some issues, but now the programm at least compiles. However, if I try to run this programm, I get a (0xc0000005) error on initialization, when I try to use the native class. As this happens on initialization, I don't even see, which DLLs fail to initialize. All DLLs should be in the right place.

Any hints? Thank you.


I have a similar issue; Qt with C++ and /clr. I made a wrapper for a managed class and then made the front end with Qt and I get the warnings…

Take a look at this discussion on bytes.com: __fastcall functions in a static lib, cant be called from managed code?

The guy there says that static managed classes compiled with /clr are incompatible with fastcall.


The project, which called the native class was linked statically to my exe and this did not worked. I changed it to a DLL and now it seems to work.

I'll investigate a little more.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号