durs / node-activex

Node.JS Implementaion of ActiveXObject
MIT License
329 stars 62 forks source link

Winax is unable to call a method in the com component #134

Closed Liuhangshuo closed 8 months ago

Liuhangshuo commented 8 months ago

const winax = require('winax');

const safeEngine = winax.Object('SafeEngineCOM.SafeEngineCtl', { activate: true });

console.log("Result Type:", typeof safeEngine); const methodsAndProperties1 = Object.keys(safeEngine.__methods); console.log(methodsAndProperties1);

try { const result = safeEngine.SEH_InitialSession(2, '', '', 0, 2, '', ''); console.log("Result Type:", typeof result); console.log("Result:", result); } catch (error) { console.error("Error:", error); }

Print the logs: Result Type: function [ 'QueryInterface', 'AddRef', 'GetIDsOfNames', 'Invoke', 'SEH_InitialSession', ... 42 more items ] Result Type: undefined Result: undefined

Used regsvr32 SafeEngineCOM.dll Both are 32 bits The correct return should be 0, tested on python no problem

Liuhangshuo commented 8 months ago

有一种可能,我调取方法成功了,但是获取不到返回类型和值

Liuhangshuo commented 8 months ago

已经可以调用了,只是和python的接收方法的返回内容不一样,一直以为是没调用成功