C#Winfrom下调用C++

来源:互联网 发布:黑马程序员毕业证 编辑:程序博客网 时间:2024/05/16 06:19
把要调用的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);
原创粉丝点击