Skip to content

Using COM is possible in 0.10.33 but not in 6.9.1 and also not in 4.6.2 #514

@emagiz

Description

@emagiz

Hi,

I tried getting attached code to work in a newer version of nodejs and it seems to fail for a reason I am unable to find out.

It fails with an 'Illegal characters in path.' problem but the real cause might be something else. I don't know. It works without problems in version 0.10.33 of node.

Source code below:

$ node hello-edge.js
Load edge native library from: g:\products\postnl-solution\poc-scale\node_modules\edge\lib\native\win32\ia32\4.1.1\edge_nativeclr
edge::init
V8SynchronizationContext::Initialize
V8SynchronizationContext::Unref
ClrFunc::Initialize MethodInfo wrapper
ClrFunc::Initialize Func<object,Task> wrapper
clrFuncProxy
ClrFunc::Call instance
ClrFuncInvokeContext::ClrFuncInvokeContext
ClrFuncInvokeContext::CompleteOnV8Thread
ClrFunc::MarshalCLRExceptionToV8
ClrFunc::MarshalCLRObjectToV8
ClrFunc::MarshalCLRObjectToV8
undefined
{ [System.ArgumentException: Illegal characters in path.]
Message: 'Illegal characters in path.',
ParamName: null,
Data: {},
InnerException: null,
TargetSite: {},
StackTrace: ' at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)\r\n at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)\r\n at System.IO.FileInfo.Init(String fileName, Boolean checkHost)\r\n at System.IO.FileInfo..ctor(String fileName)\r\n at System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly)\r\n at System.ComponentModel.LicenseManager.LicenseInteropHelper.GetCurrentContextInfo(Int32& fDesignTime, IntPtr& bstrKey, RuntimeTypeHandle rth)\r\n at Startup.d__0.MoveNext() in c:\Users\Bas\AppData\Local\Temp\add7.csx:line 13',
HelpLink: null,
Source: 'mscorlib',
HResult: -2147024809,
message: 'Illegal characters in path.',
name: 'System.ArgumentException' }
ClrFuncInvokeContext::DisposeCallback
ClrFuncInvokeContext::CompleteOnV8Thread - async with callback

Bas@BASELZINGA /G/products/postnl-solution/poc-scale (master)

// Overview of edge.js: http://tjanczuk.github.com/edge

var edge = require('edge');

var helloWorld = edge.func({
    source:'add7.csx',
references: ['System.Data.dll', 'Interop.MTLibrary.dll', 'Interop.MTScaleConnectionActiveProj1.dll', 'Interop.MTScaleConnectionServer.dll']});

var sendImpl = function (error, result) {
    console.log(result);
    console.log(error);
};

helloWorld('hoi', sendImpl);

and:

using System;
using System.Data;
using System.Threading.Tasks;
using MTScaleConnectionActiveProj1;

public class Startup
{
public MTScaleConnectionActiveXClass axMTScaleConnectionActiveX1;
private Func<object, Task<object>>  SendImpl { get; set; }

public async Task<object> Invoke(string sendImpl)
{
    axMTScaleConnectionActiveX1 = new MTScaleConnectionActiveXClass();
    axMTScaleConnectionActiveX1.MTDevice = 1;
    axMTScaleConnectionActiveX1.Active = true;

    System.Console.WriteLine(sendImpl);
    return sendImpl;
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions