Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with MSWINSCK.OCX WinSock control
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00402471
Message ID:
00404080
Views:
16
Jon & Chuck,

Thank you guys so much for all your help. I found out 2 very valuable things about the Winsock client and VFP.

1) You must use the .OBJECT refrence when invoking the CONNECT or CLOSE event. For example:

ThisForm.olecontrol1.OBJECT.Connect()

2) You must use the following sintax to recieve data using the GETDATA event:

lcRecvData = ""
ThisForm.olecontrol1.GetData(@lcRecvData,8,bytestotal)

On the second one, I don't understand it fully, but thanks to the person who posted file #1276 (remote host). I wouldn't have got that without them.

Sincerely,
Don Knoup
dknoup@unitydc.com
Unique Solutions


>Jon,
>
>Thanks! I'll be sure to check that out. However, I found out why I could not connect. Apparently FoxPro doesn't like it when a control has an event and method by the same name. To invoke the method you need to include the .OBJECT refrence.
>
>Here is my new code that works:
>
>ThisForm.olecontrol1.RemoteHost = "192.0.0.50"
>ThisForm.olecontrol1.Remoteport = 1070
>ThisForm.olecontorl1.OBJECT.Connect()
>
>By Adding the word .OBJECT, I was able to make my connection. By the way the same is true of the CLOSE method. For example:
>
>ThisForm.olecontrol1.OBJECT.Close()
>
>Now, If I can just figure out the GETDATA event??? I've made my connection, I can send data to the terminal that I have connected to. I just can't seem to get any data back? Anyone have any ideas??
>
>Thanks in advance,
>Don Knoup
>dknoup@unitydc.com
>Unique Solutions
>
>
>>Hi Don,
>>
>>>Boy, you know you're desperate when you reply to your own message!
>>>
>>>Does anyone know where I could find more detailed documentation on using the winsock control from VFP? The help file is not exactly what I would call "thorough" .
>>>
>>>Thanks,
>>>Don Knoup
>>>dknoup@unitydc.com
>>>Unique Solutions
>>
>>Check out File #9752 Remote host control in the Files/Classes section. It's an example of how to implement the WinSock control within VFP by Vijayaraman L. Narasimhan.
>>FWIW, I believe he used UDP, not TCP.
>>
>>Jon
Don Knoup
don.knoup@ticomix.com
Ticomix, Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform