jscript & COM 
Author Message
 jscript & COM

Hi,

This may be a stupid question, but anyway, can you create
and use COM objects in jscript?

If so, I want to port some VBScript code, like the
following, to jscript.

.....

set wsiLM = createObject("wSAP.wLoginManager")

set wsiSI = wsiLM.Login(cStr(name), cStr
(pword), "devci01", "210", "EN")

.... . .

thanks,
Ben



Wed, 21 Dec 2005 09:22:29 GMT  
 jscript & COM
var wsiLM = new ActivexObject("wSAP.wLoginManager");

I'm not familiar with any gotchas in terms of calling the components though.

Chris.


Quote:
> Hi,

> This may be a stupid question, but anyway, can you create
> and use COM objects in jscript?

> If so, I want to port some VBScript code, like the
> following, to jscript.

> .....

> set wsiLM = createObject("wSAP.wLoginManager")

> set wsiSI = wsiLM.Login(cStr(name), cStr
> (pword), "devci01", "210", "EN")

> .... . .

> thanks,
> Ben



Wed, 21 Dec 2005 09:38:07 GMT  
 jscript & COM

Quote:
> I'm not familiar with any gotchas in terms of calling the components
> though.

The 3 most common JScript COM gotchas...

By reference arguments, anything other than trailing optional arguments, and
VBScript style SAFEARRAYs.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US

Technet Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp

Microsoft? Windows?2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overvie...



Wed, 21 Dec 2005 09:59:07 GMT  
 jscript & COM
Thanks Michael.

I'm an ASP / VBScript by nature so the JScript stuff server-side is a bit
baffling at times. LoL.

Chris.



Quote:
> > I'm not familiar with any gotchas in terms of calling the components
> > though.

> The 3 most common JScript COM gotchas...

> By reference arguments, anything other than trailing optional arguments,
and
> VBScript style SAFEARRAYs.

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US

> Technet Script Center
> http://www.microsoft.com/technet/scriptcenter/default.asp

> Microsoft? Windows?2000 Scripting Guide
> http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overvie...



Wed, 21 Dec 2005 10:12:57 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Jscript & COM

2. VBScript, COM Events & Safe Arrays

3. Strings, VBScript & COM Objects

4. Error Handling using VBScript & COM

5. Strings, VBScript & COM Objects

6. C# IEnumerator & COM interop w/ WSH

7. Callbacks from COM objects in Jscript

8. Calling COM API from JScript !

9. Catching COM object errors in server-side jscript?

10. Using COM objects that return recordsets from JScript

11. JSCript and returning parameters from COM object

 

 
Powered by phpBB® Forum Software