任务将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;
}
答案 0 :(得分:1)
Func<IntPtr, Int32, Int32, Int32>::typeid
?