如何使用C ++ DLL在C#项目?如何使用、项目、DLL

2023-09-04 01:08:02 作者:年少的时光掌心纹路

可能重复:   在C#应用程序使用C ++类的DLL

Possible Duplicate: Using C++ Class DLL in C# Application

我尝试无法添加引用添加C ++ DLL在C#

I try to failed to add reference to add c++ dll in c#

如果您添加或使用C ++ DLL在C#中的任何其他方法。我们如何使用?

if you have any other method to add or use c++ dll in c#. how can we use?

我在哪里弄错添加DLL在我的C#项目?

Where do i mistake to add dll in my c# project?

在此先感谢

推荐答案

有关在C#中使用本地C ++库,主要是必须创建一个的 C ++ / CLI 包装的。 P /调用就可以了,只要你的DLL的API只包含简单的C类的功能,但是当API包含真正的C ++类,C ++ / CLI IST多的那个任务更好。

For using native C++ libraries in C#, you mostly will have to create a C++/CLI wrapper for that. P/Invoke is ok as long as the API of your DLL contains just simple C-like functions, but when the API contains real C++ classes, C++/CLI ist much better for that task.

 
精彩推荐
图片推荐