注册COM dll时是否可以执行任意C#代码?

时间:2019-05-04 07:43:12

标签: .net-core com

我正在尝试将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?

0 个答案:

没有答案