Microsoft KB Archive/315124

= How to use the Winsock ActiveX control with Visual FoxPro =

Article ID: 315124

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 7.0 Professional Edition
 * Microsoft Visual FoxPro 8.0 Professional Edition
 * Microsoft Visual FoxPro 9.0 Professional Edition

-



This article was previously published under Q315124



SUMMARY
The FoxSock.exe sample is adapted from the first Microsoft Visual Basic sample presented in the article &quot;Using the Winsock Control&quot;, which is available at the following MSDN Web site:

http://msdn.Microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingwinsockcontrol.asp

The Microsoft Winsock Control ships with Visual FoxPro (VFP) 6.0 and later. It is not supported in VFP 5.0. This sample has been tested on Microsoft Windows 98, Microsoft Windows 2000, and Microsoft Windows XP.



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

Download the FoxSock.exe package now. Release Date: February 22, 2002

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The FoxSock.exe file contains the following files:

To use this sample, follow these steps:
 * 1) Unzip FoxSock.exe to your computer, and then set the default directory in Visual FoxPro to the directory to which you extracted the files.
 * 2) Run Winsock.prg to launch the server and client forms.
 * 3) Click Connect on the client form, and type some text in the Send text box in either form. When you leave the Send box, your text will appear in the other form's Receive box.

Differences from the Visual Basic sample include the following:
 * You need to use the &quot;.Object&quot; syntax when you call the Winsock control's methods (for instance, oleWinsock.Object.Connect) instead of referring to the control directly from the OleControl.
 * The control setup code is placed in the Init method instead of the Load method. The Visual Basic example does not close the connection. If you close the forms in VFP without closing the connection first, VFP appears to stop responding (hang) for a while.
 * Additional settings (Close buttons, tab order) were made for clarity.

Additional query words: FoxSock

Keywords: kbdownload kbfile kbhowto KB315124

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.