Pass by reference from ActiveX to J-Script? 
Author Message
 Pass by reference from ActiveX to J-Script?

Hi All-

    Is it possible?

    In other words, I'm using the MS Winsock ActiveX Control, calling the following method+ADs-

void GetData(
                +AFs-in+AF0- VARIANT+ACo- data,
                +AFs-in, optional+AF0- VARIANT type,
                +AFs-in, optional+AF0- VARIANT maxLen)+ADs-

    In J-Script, my code looks like this+ADs-

  var data+ADs-
  wsock.GetData(data)+ADs-
  document.all.txtComments.insertAdjacentText(+ACI-BeforeEnd+ACI-, +ACI-Rcvd: +ACI- +- data +- +ACIAXA-r+ACI-)+ADs-

This doesn't work+ADs- 'data' remains UNDEFINED.  I'm new to J-Script, so please don't dismiss the obvious.  Is there some way to coerce 'data' to make this function call possible?

Thanks.
-Aaron



Sun, 04 Nov 2001 03:00:00 GMT  
 Pass by reference from ActiveX to J-Script?
JScript doesn't support byref I'm afraid so you won't be able to do this

--

Regards

Andrew Clinick
Windows Script Program Manager
http://msdn.microsoft.com/scripting


Hi All-

    Is it possible?

    In other words, I'm using the MS Winsock ActiveX Control, calling the
following method;

void GetData(
                [in] VARIANT* data,
                [in, optional] VARIANT type,
                [in, optional] VARIANT maxLen);

    In J-Script, my code looks like this;

  var data;
  wsock.GetData(data);
  document.all.txtComments.insertAdjacentText("BeforeEnd", "Rcvd: " + data +
"\r");

This doesn't work; 'data' remains UNDEFINED.  I'm new to J-Script, so please
don't dismiss the obvious.  Is there some way to coerce 'data' to make this
function call possible?

Thanks.
-Aaron



Mon, 05 Nov 2001 03:00:00 GMT  
 Pass by reference from ActiveX to J-Script?


Quote:
> JScript doesn't support byref I'm afraid so you won't be able to do this

...but what you will be able to do is to get the excellent ScriptX control
from http://www.meadroid.com/scriptx and use the InvokeByRef method for this
purpose; e.g.

  var factory = new ActiveXObject("ScriptX.Factory");
  var args = new Array(data, type, maxLen);
  factory.js.InvokeByRef(wsock, "GetData", args); // invoke
wsock.GetData(data, type, maxLen)
  document.all.txtComments.insertAdjacentText("BeforeEnd", "Rcvd: " +
args[0] + "\r");

IMPORTANT: Note that the received data is in args[0], not the variable
called "data" !

Hope this helps,

- Oisin



Tue, 06 Nov 2001 03:00:00 GMT  
 Pass by reference from ActiveX to J-Script?
Thanks for mention this, Oisin!
Those who interesting to make own componets JScript-by-ref-friendly the
transparent way, stay tuned ;-)
I'm going to add new CAuxByRef class to free ATL/AUX library:
http://www.geocities.com/~andien/atlaux.htm
http://www.geocities.com/~andien/atlaux_manual.htm

--
Regards,
Andrew Nosenko,
Mead & Company
Innovative browser extensions for weblications(!):
http://www.meadroid.com/wpm/
MeadCo HTML printing article and samples:
http://msdn.microsoft.com/workshop/author/script/dhtmlprint.asp
http://www.meadroid.com/scriptx/samples/print.htm



Quote:
> JScript doesn't support byref I'm afraid so you won't be able to do this

...but what you will be able to do is to get the excellent ScriptX control
from http://www.meadroid.com/scriptx and use the InvokeByRef method for this
purpose; e.g.

  var factory = new ActiveXObject("ScriptX.Factory");
  var args = new Array(data, type, maxLen);
  factory.js.InvokeByRef(wsock, "GetData", args); // invoke
wsock.GetData(data, type, maxLen)
  document.all.txtComments.insertAdjacentText("BeforeEnd", "Rcvd: " +
args[0] + "\r");

IMPORTANT: Note that the received data is in args[0], not the variable
called "data" !

Hope this helps,

- Oisin



Wed, 07 Nov 2001 03:00:00 GMT  
 Pass by reference from ActiveX to J-Script?
And here it is:
http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind9905d&L=atl&F=&...

--
Regards,
Andrew Nosenko,
Mead & Company
Innovative browser extensions for weblications(!):
http://www.meadroid.com/wpm/
MeadCo HTML printing article and samples:
http://msdn.microsoft.com/workshop/author/script/dhtmlprint.asp
http://www.meadroid.com/scriptx/samples/print.htm



Wed, 07 Nov 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Passing JScript variables by reference to an ActiveX component

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

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

4. Passing Params by Reference to ActiveX Method

5. Passing Reference Params to ActiveX Method

6. passing parameter by reference from jscript to com

7. How to pass Jscript arrays to ActiveX objects?

8. How To Pass JScript Array to ActiveX Control

9. Passing an object reference by reference where the object has a default property

10. Passing Object References from Application to Script Code

11. passing references to COM objects in script

12. Passing an object to an ActiveX dll from ASP script

 

 
Powered by phpBB® Forum Software