添加一个cs文件,在里面定义回调
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.InteropServices;
namespace GotecomBigDipper
{
[ Serializable ]
[ ComVisible (true )]
public delegate void RS_DATA_CALLBACK (System.UInt32 _WPARAM, System. Int32 _lParam);
}
在其他地方声明一个函数
public extern static bool RSDataCallBack( RS_DATA_CALLBACK callback);
回调函数的具体实现如下
private void sdkCallback(System. UInt32 _WPARAM, System. Int32 _lParam)
{
for (int i = 0; i <= 1; i++)
{
_WPARAM = WPARAM[i];
lParam[i] = _lParam;
}
}
最终回调被调用时可以如下:
GetSdkBLL .RSDataCallBack(sdkCallback);