How can I use ActiveX DLL in c# code snippet for node js using edge js?

456 views Asked by At

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.

0

There are 0 answers