如何通过C ++ CRL类库调用我的非托管C ++ DLL
问题描述:
在VS2015中,我想在C ++ CRL类库中调用我的标准C ++代码,然后在给定C#的情况下创建DLL。我不知道设置这个文件和交换参数。你能给我一些关于它的例子吗?非常感谢你。
我的尝试:
In VS2015,我想在C ++ CRL类库中调用我的标准C ++代码,然后在给定C#的情况下创建DLL。我不知道设置这个文件和交换参数。你能给我一些关于它的例子吗?非常感谢。
In the VS2015 , I want to call my standard C++ codes in the C++ CRL class library, and then creat DLL given the C# . I don't know to setting this files and exchange parameter. Can you give me some examples about it? thank you very much.
What I have tried:
In the VS2015 , I want to call my standard C++ codes in the C++ CRL class library, and then creat DLL given the C# . I don't know to setting this files and exchange parameter. Can you give me some examples about it? thank you very much.
答
很简单,用c ++创建你的逻辑dll。只需在c#中使用DLLImport类就可以在c#中使用c ++ dll方法。
了解DllImport以及如何实现它。
快乐编码
Hi,
Its simple , Create your logic dll from c++ . Simply use DLLImport class in c# to use your c++ dll methods in c#.
Read about DllImport and how to implement it.
Happy coding