我有一个dll,它接受一个包含指向函数的指针的结构来进行回调。
如何将IntPtr作为我的应用程序的函数来构建结构?
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public class OPERATION {
public uint OperationID;
public IntPtr Context;
public IntPtr Callback; -> How to pass this?
}
这是接受OPERATION结构的委托
public delegate void MY_CALLBACK([In] OPERATION operation, [In] uint msgId, [In] IntPtr msgDataPtr);