tags:

views:

51

answers:

2

Hi All, I drive into this issue: I create COM object using C#, register it and managed to work with it using powershell. when i trying to do the same with JavaScript it fails, but javascript keeps throwing object null errors.

Do you have any advice on how to fix this problem? or maybe you JavaScript doesn't support COM (if so, where can i read more about it)???

Thanks a lot!

A: 

Javascript indeed does not support COM. An option is to use JScript and an ActiveX wrapper to a COM object. Also, it will only work in Internet Explorer.

Instantiating a COM class
Calling functions of a COM object in JScript
Other JScript/COM tutorials, including script callbacks

Michal
Not your only option.
Jason S
So I see from your answer. Thanks for enlightening me.
Michal
A: 

Use Shanti Rao's JSDB shell. It's based on the core Spidermonkey engine (Mozilla's Javascript implementation) used in Firefox, but has a bunch of bindings for databases & ActiveX objects and such. It has a few limitations but unless you're using something complicated you should be able to make use of it.

Example:

x=new ActiveX('MSXML2.DOMDocument.6.0');
x.async = false;
// I forget how to use IXMLDOMDocument but other calls go here
Jason S