C#中调用VC++的DLL
代码说明:
[DllImport("diaCallBackDll.dll")] public static extern void show(); [DllImport("diaCallBackDll.dll", CallingConvention = CallingConvention.StdCall)] public static extern int add_CallBack_test(int a, int b, cb_func f); public static void cb_funcc(int re) { Console.WriteLine("result=[{0}]", re); return; } static void Main(string[] args) { //show(); int i = add_CallBack_test(7, 2, cb_funcc); Console.Read(); }
下载说明:请别用迅雷下载,失败请重下,重下不扣分!