0

I'm going to make a little electron-node js application that will use one activeX dll library, Interop.DrvFRLib.dll. This library works perfectly well with c# .NET Framework, so I've decided to wrap methods, provided by this DLL in c# code snippets and include those snippets in node js code with help of edge js but that failed to work. var edge = require('edge');

var funcForTry = edge.func({
    source: function() {/*

        using DrvFRLib;
        using System.Threading.Tasks;

        public class Startup
        {
            public async Task<object> Invoke(object input)
            {
                var driver = new DrvFR();
                return null;
            }
        }
        */},
    references: [ 'Interop.DrvFRLib.dll' ]
});

funcForTry(null, function (error, result) {
    console.log(result);
});

This line of code:

var driver = new DrvFR();

gives me an error message stating that file or assembly cannot be found

"Interop.DrvFRLib, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null"

What the reason may be? Library file resides in same folder as index.js. This very library works well with native c# in, say, console app, when I put it into "References". Of course it's CLSID can be founded under the HKEY_CLASSES_ROOT registry branch.

daedsidog
  • 1,732
  • 2
  • 17
  • 36
  • Interoip.DrvFRLib.dll is a .net assembly, not the ActiveX component. The CLR uses standard lookup rules to find assemblies. First in the GAC, next in the directory where the EXE is stored. So the directory where node.exe resides, not where the .js file is stored. – Hans Passant Dec 04 '18 at 10:45
  • I did what you've suggested - dll file was moved to where node.exe resides. Error message has changed also. "Attempt of loading file with wrong format". It seems that node/edge system dislikes this library at all :) – Roman Rimmer Dec 05 '18 at 11:00

0 Answers0