idobatter / node-win32ole

Asynchronous, non-blocking win32ole bindings for node.js .
http://idobatter.github.com/node-win32ole/
208 stars 53 forks source link

Cannot handle VT_I2 (int16) variants.. #10

Open TheInsomniac opened 10 years ago

TheInsomniac commented 10 years ago

I have a program that returns many values as type VT_I2. Is there a way to get node-win32ole to handle these? I notice that it handles 32 and 64 bit ints and can't think of any reason why it WON'T work but.. I've never worked with C++ before.

Thanks!

Antony74 commented 10 years ago

Are you able to provide example-code to illustrate this problem, please?

TheInsomniac commented 10 years ago

I'm connecting to my Homeseer home automation software (I was previously using Python to do this but wanted to attempt it in Node.js). The setup:

var win32ole = require('win32ole');
var hs = win32ole.client.Dispatch('Homeseer.Application');

Works as it does not return a response value but Homeseer does register the command:

hs.WriteLog("Testing", "Testing 123");

Doesn't work because the returned value is a VT_I2:

hs.DeviceStatus("Q31");
> [unknown type: 2:VT_I2 (not implemented now)]
hs.execX10("Q31");
> [unknown type: 2:VT_I2 (not implemented now)]

Thanks for the quick reply!

Antony74 commented 10 years ago

I believe I've sorted this out. Would you like to try my development version to check?

npm install win32ole-dev
TheInsomniac commented 10 years ago

Works fantastically. Thank you for performing this enhancement for me.

pvilas commented 9 years ago

Hi Antony Did you updated this? I have the same problem with VT_I2 and now it works with de dev branch. Regards.

Antony74 commented 9 years ago

I'm afraid this is not my project to update. There hasn't been a release of node-win32ole for a long time now. I'm writing a more ad hoc node extension of my own these days so I can efficiently make the batches of COM calls I require directly from C++ without everything being marshaled to JavaScript in between. :-(