任务将回调 typeof System::Func 传递给非托管函数。
//c++ clr
class Unmanagement
{
void Test()
{
Marshal::GetDelegateForFunctionPointer(callback,);//<----how to specify the type?
}
IntPtr callback;
}
bool Init(Func<IntPtr, Int32, Int32,Int32>^ callback)
{
Unmanagement a=new Unmanagement;
IntPtr cb=Marshal::GetFunctionPointerForDelegate(callback);
a->callback=cb;
}