2

Is it possible (using one of the server side implementations of javascript .. see http://www.nakedjavascript.com/getting-started-55) to instantiate a COM object and invoke methods on it?

Nigel Thorne
  • 21,158
  • 3
  • 35
  • 51

2 Answers2

4

There is node-win32ole (npm install win32ole).

JohnB
  • 1,231
  • 1
  • 18
  • 33
idobatter
  • 99
  • 5
1

That depends on which server-side implementation you’re using. When using ASP/JS (or any other framework using Microsoft’s Windows Scripting engine), that’s not a problem using the ActiveXObject constructor.
When using JSDB, you can use the ActiveX constructor.

Node.js doesn’t really work on Windows, only thru Cygwin, so ActiveX probably won’t be supported.

I have no idea how easy or difficult it would be to access COM objects from SpiderMonkey, V8 or SquirrelFish directly. They have C/C++ interfaces — and are open source, so if you know your way in the language, you could probably add it.

Martijn
  • 13,225
  • 3
  • 48
  • 58
  • Thanks for the prompt response. I guess I could wrap COM using something like https://github.com/tsa/vu8 . I have no idea how much work that would be. What interfaces would you need as a minimum? I guess ruby's win32ole.c could be a good place to starthttp://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/ – Nigel Thorne Feb 22 '11 at 09:44
  • Also, I don’t know if .Net is an option, but in that case you should check out [this question](http://stackoverflow.com/questions/356948/referencing-googles-v8-engine-from-a-net-app). – Martijn Feb 22 '11 at 09:53