Tag: param

PInvoke C#:Function将指针作为参数

我想在我的c#代码中访问这个函数,这可能吗? 所以最后c ++代码会调用我的函数并应用名为“sFrameofData”的结构。 C ++代码: //The user supplied function will be called whenever a frame of data arrives. DLL int Cortex_SetDataHandlerFunc(void (*MyFunction)(sFrameOfData* pFrameOfData)); 这可能会起作用吗? C#代码: [DllImport(“Cortex_SDK.dll”)] public extern static int Cortex_SetDataHandlerFunc(ref IntPtr function(ref IntPtr pFrameOfData) );