Passing JScript variables by reference to an ActiveX component 
Author Message
 Passing JScript variables by reference to an ActiveX component

I have recently done a lot of research into
ActiveX components. After figuring out how to
achieve call-by-reference semantics for arguments
passed to an ActiveX component method from
VBScript, I discovered that an almost identical
invocation of this method in JScript does not
modify the passed argument(s). I did read in the
JScript documentation that only objects, strings,
and arrays are passed by reference but even when
the argument is of string type prior to the
method call, it does not contain the appropriate
value after the call returns.  Interresting too
is that the return value does work in both
VBScript and JScript.  So if anyone could shed
some light on this problem it would be much
appreciated.

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Sun, 10 Feb 2002 03:00:00 GMT  
 Passing JScript variables by reference to an ActiveX component
howdy--

I think that if you read the docs again you'll find that ONLY objects are
passed by reference in JScript.

T

Quote:

> I have recently done a lot of research into
> ActiveX components. After figuring out how to
> achieve call-by-reference semantics for arguments
> passed to an ActiveX component method from
> VBScript, I discovered that an almost identical
> invocation of this method in JScript does not
> modify the passed argument(s). I did read in the
> JScript documentation that only objects, strings,
> and arrays are passed by reference but even when
> the argument is of string type prior to the
> method call, it does not contain the appropriate
> value after the call returns.  Interresting too
> is that the return value does work in both
> VBScript and JScript.  So if anyone could shed
> some light on this problem it would be much
> appreciated.

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Mon, 11 Feb 2002 03:00:00 GMT  
 Passing JScript variables by reference to an ActiveX component
howdy--

never mind, ignore my last post.  I don't know what's wrong.  Shouldn't
have said anything.

T



Tue, 12 Feb 2002 03:00:00 GMT  
 Passing JScript variables by reference to an ActiveX component
It's known VBScript allows only [in,out] VARIANT* by-ref arguments, while
JScript doesn't support by-refs at all. I proposed a semi-solution to this:
http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind9905d&L=atl&F=&...
Another solution can be used without mods to ActiveX code:
http://www.meadroid.com/scriptx/docs.htm#InvokeByRef

Regards,
Andrew Nosenko,
Senior Software Engineer
Mead & Company

Custom look & feel for browser windows:
http://www.meadroid.com/wpm/
MeadCo HTML printing article and samples on the MSDN:
http://msdn.microsoft.com/workshop/author/script/dhtmlprint.asp
Advanced HTML printing:
http://www.meadroid.com/scriptx/

I have recently done a lot of research into
ActiveX components. After figuring out how to
achieve call-by-reference semantics for arguments
passed to an ActiveX component method from
VBScript, I discovered that an almost identical
invocation of this method in JScript does not
modify the passed argument(s). I did read in the
JScript documentation that only objects, strings,
and arrays are passed by reference but even when
the argument is of string type prior to the
method call, it does not contain the appropriate
value after the call returns.  Interresting too
is that the return value does work in both
VBScript and JScript.  So if anyone could shed
some light on this problem it would be much
appreciated.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Wed, 13 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to pass Date type variable to a custom ActiveX component

2. Passing by reference to an ATL COM component

3. pass a COM object reference to a WSC component

4. passing array as parameter to activex component

5. Passing Arrays between ASP/VBScript and ActiveX Components...

6. passing array as parameter to activex component

7. Passing Arrays between ASP/VBScript and ActiveX Components...

8. Passing values by reference from java / vb script to ActiveX object

9. Pass by reference from ActiveX to J-Script?

10. Passing Params by Reference to ActiveX Method

11. Passing Reference Params to ActiveX Method

12. Passing values by reference from java / vb script to ActiveX object

 

 
Powered by phpBB® Forum Software