.netcore中的Com Interop(使用vb6 com dll)

时间:2016-10-31 17:58:51

标签: c# .net-core

我根本无法加载vb6样式的com dll。我得到了一个没有注册的课程#34;即使它是错误的。那么.net核心中根本不支持vb6 com dll?还有其他人试过吗?

public static void Main(string[] args)
{
    var r = Ole32Methods.CoInitialize(new IntPtr(0));

    const uint CLSCTX_INPROC_SERVER = 1;
    Guid clsid = new Guid("C31CBF72-92C6-4A47-A4C4-935706C26D34");

    // GUID of the required interface
    Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");

    object instance = null;

    uint hResult = Ole32Methods.CoCreateInstance(ref clsid, null,
                   CLSCTX_INPROC_SERVER, ref IID_IUnknown, out instance);

    _ICommonUI sidCUI = instance as _ICommonUI;

    sidCUI.Show(1, null);
}

0 个答案:

没有答案
相关问题