我正在尝试将C ++编写的Windows IME sample移植到C#/。NET Core 3中。
C ++示例具有全局DllRegisterServer函数,该函数将由regsvr32
调用:
STDAPI DllRegisterServer(void)
{
if ((!RegisterServer()) || (!RegisterProfiles()) || (!RegisterCategories()))
{
DllUnregisterServer();
return E_FAIL;
}
return S_OK;
}
在这里,RegisterServer()
与COM注册有关,而其他人则将样本注册为IME。 .NET Core 3 automatically does the former for me中的COM填充程序,但是我不确定如何在C#中调用其他人。
通过regsvr32
注册dll时是否可以执行任意C#代码,以便我可以将dll注册为IME?