菜鸟求救C#调用DLL 回调函数不执行
回调函数原型
typedef void (WINAPI *HHCALLBACK)(int CmdType, ERRTYPE errType, int nDevId,int nChannelID, void *pContext);
ERRTYPE 是个枚举类型
要调用的dll中的函数
HHAPI_DLL int __stdcall Initialize( char* pConfigFileName, HHCALLBACK pCallback );
我声明的委托
public delegate void HHCALLBACK(int CmdType, ERRTYPE errType, intnDevId, int nChannelID, IntPtr pContext);
DLl的引用
[DllImport("HHSDK.dll", CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int HHInitialize(StringBuilder pConfigFileName, JSCALLBACK pCallback);
回调函数体
public static void call(int CmdType, ERRTYPE errType, int nDevId, int nChannelID, IntPtr pContext)
{
。。。。。。。。。。。
}
问题:::
在程序中执行 这个HHInitialize有返回值1
可是这个回调函数无法执行。
请问是什么原因。小弟感激涕零。。。。。。。。。救命啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!