如何用C#创建事件句柄传入C++写的驱动Dll? C++写的驱动头文件如下: ZT_API long _stdcall ZT518_OpenIRQ(unsigned long cardNO, long hEventSFifo, long hEventHFifoFewData, long hEventHFifoHalf, long hEventEI1, long hEventEI2, long hEventADFinish);
不知道如何在C#创建事件句柄,并传入这个Dll函数? [DllImport("pm518.dll")] public static extern int ZT518_OpenIRQ(int cardNO, int hEventSFifo, int hEventHFifoFewData, int hEventHFifoHalf, int hEventEI1, int hEventEI2, int hEventADFinish);
------解决方案--------------------
C# code
[DllImport("pm518.dll")]
public static extern int ZT518_OpenIRQ(
int cardNO,
SafeWaitHandle hEventSFifo,
...
);
AutoResetEvent eventSFifo = new AutoResetEvent(false);
//ThreadPool.RegisterWaitForSingleObject(eventSFifo.SafeWaitHandle, OnEventSFifo, null, 0, true);
OpenIRQ(cardNO, eventSFifo.SafeWaitHandle, ...);
------解决方案--------------------