P
Pepa Cougar
Hello,
I'm trying to write a managed C++ wrapper for my old C++ classes but I
encountered a following problem:
I have two .lib files with the old unmanaged code. Both libs are set
to use *static multithreaded runtime library*.
I wrote a managed C++ library which wraps the unmanaged code. The
library is compiled as a DLL library (.NET assembly) also with static
multithreaded runtime library.
Now I have a testing C# application which imports the wrapper
assembly. But whenewer the C# app tries to create an instance of any
wrapper class, it crashes (NullReferenceException). It crashes at the
point where the managed class tries to (internally) create an instance
of the underlying unmanaged class.
Ok, but the funny thing is, that if I switch the runtime library to
multithreaded DLL, it doesn't crash anymore. What could be the
difference between static and DLL runtime libraries in this case? Can
anyone give me any pointers, because I'm becoming pretty hopeless...
Thanks in advance.
I'm trying to write a managed C++ wrapper for my old C++ classes but I
encountered a following problem:
I have two .lib files with the old unmanaged code. Both libs are set
to use *static multithreaded runtime library*.
I wrote a managed C++ library which wraps the unmanaged code. The
library is compiled as a DLL library (.NET assembly) also with static
multithreaded runtime library.
Now I have a testing C# application which imports the wrapper
assembly. But whenewer the C# app tries to create an instance of any
wrapper class, it crashes (NullReferenceException). It crashes at the
point where the managed class tries to (internally) create an instance
of the underlying unmanaged class.
Ok, but the funny thing is, that if I switch the runtime library to
multithreaded DLL, it doesn't crash anymore. What could be the
difference between static and DLL runtime libraries in this case? Can
anyone give me any pointers, because I'm becoming pretty hopeless...
Thanks in advance.