Reputation: 27996
I have an unmanaged class that I'm trying to dllexport from a managed DLL file. I'm trying to use the unmanaged class in another managed DLL file. However, when I try to do this I get link errors.
I've done this lots of times with unmanaged DLL files, so I know how that works. I know how to use "public ref", etc. in managed classes.
Is there some flag somewhere I need to set? Or do I have to do some DllImport magic?
This is on .NET 2.0 and Visual Studio 2005.
Upvotes: 1
Views: 1809
Reputation: 20901
If you want to use an unmanaged class from managed code, you can:
If you need more information on the second option, I could look up some old links that explained this technique more.
Upvotes: 3
Reputation: 4793
If it is a COM DLL file then you can use COM .NET interoperability. Stack Overflow question Is there a best practice for accessing C++ native COM functions to interop from C#? is another question which answers this.
Upvotes: 0
Reputation: 1805
You need to use an interop assembly for unmanaged libraries or COM components. Here is a link with good information regarding this.
Upvotes: 1