0

I want to create a Windows desktop application with electron.js that will load and use .NET assembly (for example, call it "Display.dll"). This assembly depends on external dll ("Line1C.dll") that shipped with some hardware. Seems like Line1C is a COM-object, but, unfortunately, I haven't any docs.

I can instantiate class Line1C.Line45 from Line1C.dll in my winforms application simple by adding "using Line1C;", reference to a dll-file in "References" in Visual Studio and it works fine.

enter image description here

I can call classes in .NET assemblies from my electron application with electron-edge, but when I trying to call Display.dll's class method that creates Line1C.Line45 instance, I get an exception:

"System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {9AA62C52-999A-11D3-9DB5-0000E8DBEDCE} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Is there a way to make this to work like in a usual .net application?

4

1 回答 1

1

问题是无法在 64 位应用程序中直接获取 32 位 COM 对象。所以我为 ia32 架构构建了我的电子应用程序(重建电子边缘),它现在可以工作了。

于 2017-04-21T07:37:34.603 回答