我在使用C++/CLI,我发现了一个问题。
C#传递过来一个变量,类型是
[System::Runtime::InteropServices::UnmanagedFunctionPointerAttribute(System::Runtime::InteropServices::CallingConvention::StdCall, CharSet = System::Runtime::InteropServices::CharSet::Unicode)]
public delegate int pfnCallback(int Result);
我需要将这个类型的变量赋值给
typedef int(__stdcall* pfnNativeCallback)(int Result);
//伪代码
void SetCallback(pfnCallback^ callback)
{
pfnNativeCallback pNativeCallback = callback; //我要怎样才能实现这样的操作?
}