C# 中调用C++ DLL

joga9615457 12 0 RAR 2021-04-23 04:04:02

为了能用上原来的C++代码,只好研究下从C# 中调用DLL 首先必须要有一个声明,使用的是DllImport关键字: 包含DllImport所在的名字空间 using System.Runtime.InteropServices; public class XXXX{ [DllImport(“MyDLL.dll")] public static extern int mySum (int a,int b); } [DllImport(“MyDLL.dll")] public static extern int mySum (int a,int b); 代码中DllImpo

用户评论
请输入评论内容
评分:
暂无评论