我必须创建一个C#DLL调用C ++ DLL或我可以直接从我的C#应用程序调用它?
Do I have to create a C# DLL to call C++ DLL or I can call it directly from my C# application?
您可以直接调用它的使用的PInvoke和的DllImport
属性。假设,当然,它有标准的C入口点,没有编译器特有的C ++入口点。
You can call it directly with PInvoke and the DllImport
attribute. Assuming, of course, that it has standard C entry points, not compiler-specific C++ entry points.
除非你在谈论C ++ / CLI,你会在这种情况下,引用.NET的DLL完全按照自己的引用任何其他.NET的DLL。
Unless you were talking about C++/CLI, in which case you would reference the .NET DLL exactly as you would reference any other .NET DLL.