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.
精彩评论