c# 调用 c++ dll

public class CPPDLL

{ [DllImport("cv.dll",EntryPoint = "add")]

public static extern int add(int x, int y);

}

class Program {

static void Main(string[] args)

{

int result = CPPDLL.add();

Console.WriteLine("10 + 20 = {0}", result);

Console.ReadLine(); }

}

form.

int result = CPPDLL.add();

猜你喜欢

转载自blog.csdn.net/lzglzj20100700/article/details/81182248