Thursday 20 April 2017

edge.js: how to call a method from .NET assembly with a reference to a COM object?

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?



via Digger2000

No comments:

Post a Comment