
GetData using MSWinsock.Winsock
GetData using MSWinsock.Winsock"[in, out] VARIANT* data" is a by reference parameter and JScript doesn't support pass by reference...
--
Michael Harris
MVP Scripting
This is GetData method as exposed by the type library.
[id(0x00000044), helpstring("Retrieve data sent by the remote computer"), helpcontext(0x00053034)]
void GetData(
[in, out] VARIANT* data,
[in, optional] VARIANT type,
[in, optional] VARIANT maxLen);
The VARIANT* data variable is not declared retval. Is there anyway for me to get this out parameter using WSH? Is there another object I can use whos interface declares this variable retval? Here is my code:
var ws = WScript.CreateObject("MSWinsock.Winsock", "ws_")
ws.Protocol = 0
ws.Connect("chessclub.com", 21)
WScript.Sleep(5000)
function ws_Connect()
{
WScript.Echo("connected")
Quote:
}
function ws_DataArrival(length)
{
WScript.Echo(length)
var data
data = "This string does not get over written"
ws.GetData(data)
WScript.Echo(data)
Quote:
}