如何使用C ++ DLL在C#项目? [英] how to use c++ dll in c# project?

查看:190
本文介绍了如何使用C ++ DLL在C#项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  在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.

这篇关于如何使用C ++ DLL在C#项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆