把要调用的C++dll拷贝到编译目录下
添加引用:
using System.Runtime.InteropServices;
声明(类似API的用法):
[DllImport("dll 名称" EntryPoint="接口名称")] 或者 [DllImport("dll 名称" CharSet=CharSet.Unicode,EntryPoint="接口名称")]
public static extern int 接口名称(IntPtr hWnd, ref float xvalue);
添加引用:
using System.Runtime.InteropServices;
声明(类似API的用法):
[DllImport("dll 名称" EntryPoint="接口名称")] 或者 [DllImport("dll 名称" CharSet=CharSet.Unicode,EntryPoint="接口名称")]
public static extern int 接口名称(IntPtr hWnd, ref float xvalue);
本文介绍如何将C++ DLL文件整合到C#项目中,并详细讲解了如何通过添加引用及声明API来实现跨语言调用的具体步骤。
1345

被折叠的 条评论
为什么被折叠?



