好的,我发现为了获得C#函数的委托,你必须使用coreCLR提供的这三个函数:
// this one first,to initialize coreCLR
int (coreclrInitializeFunction)(
const char* exePath,const char* appDomainFriendlyName,int propertyCount,const char** propertyKeys,const char** propertyValues,void** hostHandle,unsigned int* domainId);
// this one to get delegate to your C# function
int (coreclrCreateDelegateFunction)(
void* hostHandle,unsigned int domainId,const char* entryPointAssemblyName,const char* entryPointTypeName,const char* entryPointMethodName,void** delegate);
// this one on the end,to close coreCLR
int (coreclrShutdownFunction)(
void* hostHandle,unsigned int domainId);