必须使用C#DLL调用C ++的dll? [英] Have to use C# dll to call C++ dll?
本文介绍了必须使用C#DLL调用C ++的dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须创建一个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.
这篇关于必须使用C#DLL调用C ++的dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文