durs / node-activex

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

Function call that mutates an array. #102

Closed jshudson closed 3 years ago

jshudson commented 3 years ago

I have a program with a com object that expects a variant which the function populates as an array. Is this supported with this software? If so, how do I go about it? I have tried declaring an empty variable, an empty array, and an empty winax Variant all of which yield the original variable with no changes.

Thank you for any help.

Jeremy

jshudson commented 3 years ago

I was able to solve the problem by passing a new instance of the winax Variant with a 'byref' type with a reference to a previously existing variant variable:

let ax = new ActiveXObject ('Example.Application');
let existing = new Variant();
ax.PopulateArray(new Variant(existing, 'byref'));
//the existing variable is correctly populated