Using C++ Class DLL in C# Application
问题 I have an unmanaged C++ DLL which merely exports a single class (not COM...it\'s just a simple C++ class) as its interface. I want to use this class in C# but am told that it cannot merely be imported into C#. What is the right way to use this class in my C# application? 回答1: Simple way assuming class Foo: Create a C++/CLI project, call this FooWrapper. Make FooWrapper depend on the unmanaged dll (however you normally would). Create a managed class ManagedFoo which contains a single private