0x00 引言

再简单的事情,也需要有人去做。

0x01 .h文件

demo.h

extern "C" __declspec(dllexport) double Add(double a, double b); 

0x02 .cpp文件

demo.cpp

double Add( double a, double b ) { return a+b; }

0x03 C#实现

prograss.cs

using System.Runtime.InteropServices;

[DllImport("MathFuncsDll.dll", CallingConvention=CallingConvention.Cdecl)]
public static extern double Add(double a, double b);

public static void main()
{
	c = Add(c, c);
}

0x04 UPDATE

2019-02-18