The easiest way to test A COM object

This is assuming your COM object is a dual interface object (implements IDispatch).

1) Create a text file with a .js extension (eg: test.js)

2) Load the file into Visual Studio.

3) Put the following line at the top:

var arbiObj = new ActiveXObject("ArbiCOM.ArbiClassProx");

where “ArbiCOM.ArbiClassProx” is the prog id of your COM object.

4) VS will have intelisense (bellow type “arbiObj.” and your methods will be listed.

5) Go wild calling the methods. Example:

var arbiObj = new ActiveXObject("ArbiCOM.ArbiClassProx");

var ret="arbiObj.DoSomeStuff(20);<br">WScript.Echo("DoSomeStuff(20) returns " + ret);

ret = arbiObj.DoSomeStuff(19);
WScript.Echo("DoSomeStuff(19) returns " + ret);

6) To “run” your script.  Just double click in explorer.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s