public delegate void MyFuncDelegate(string sIn, StringBuilder sOut); public event MyFuncDelegate MyFuncEvent;C++ prototype:
static void MyFunc(LPCTSTR sIn, LPTSTR sOut);Tie them together with:
public void RegisterDelegateMyFunc(IntPtr ptrCallback) { MyFuncDelegate d = Marshal.GetDelegateForFunctionPointer(ptrCallback,typeof(MyFuncDelegate)) as MyFuncDelegate; if (d != null) { MyFuncEvent += d; } }
0 comments:
Post a Comment