ActiveX Object - MSWinsock.Winsock 
Author Message
 ActiveX Object - MSWinsock.Winsock

hi!

I want to use the ActiveX Object "MSWinsock.Winsock" in JavaScript to
download data from a server.
The connection works fine, and it also send data to the server.
But i can't receive anything.

after :

    var receivedData = "";
    objSocket.GetData(receivedData)

the string receivedData is still empty but BytesReceived returned that
data's are received by the winsock.

In VB i need to use the callback function DataArrival ... does this function
also exist in JavaScript ?
Or has anyone an idea on how to use this GetData function correctly ?

Thanks for the help and
cu, JNS



Thu, 01 Jan 2004 19:11:25 GMT  
 ActiveX Object - MSWinsock.Winsock

Quote:
>     var receivedData = "";
>     objSocket.GetData(receivedData)

> the string receivedData is still empty but BytesReceived returned that
> data's are received by the winsock.

Hi,

This is because JScript does not support by-ref semantics. You can't get a
function to "fill in" a variable that you pass it.

Quote:
> In VB i need to use the callback function DataArrival ... does this
function
> also exist in JavaScript ?

I don't know; what does the documentation say? How did you use it in
VBScript?

Peter

--

JScript .NET / VSA Runtime Program Manager
Please post all questions to the group. Thanks.



Fri, 02 Jan 2004 04:50:20 GMT  
 ActiveX Object - MSWinsock.Winsock
hi!

Quote:
> This is because JScript does not support by-ref semantics. You can't get a
> function to "fill in" a variable that you pass it.

ohh :(

Quote:
> I don't know; what does the documentation say? How did you use it in
> VBScript?

That's my problem ... i can't find any documentations about this topic for
JavaScript/VBScript ...
I've only used this WinSock-Control many times in VisualBasic ... and there
it works fine.

Cu, JNS



Fri, 02 Jan 2004 05:14:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Get HTML pages with mswinsock.winsock

2. GetData using MSWinsock.Winsock

3. Creating an instance of MSWinsock.Winsock gives error 0x80040112

4. MsWinSock ActiveX control / Webpage

5. Winsock : unable to generate ActiveX-component

6. Retreiving data from Java server through WinSock COM object

7. help ActiveX Error : ActiveX component can't create object

8. winsock.dll Object

9. ActiveX Error : ActiveX component can't create object

10. Winsock object

11. winsock <object>

12. Retreiving data from Java server through WinSock COM object

 

 
Powered by phpBB® Forum Software