Enabling winsock without a formVB provides a winsock control (MSWINSCK.OCX) which can be used for network communication. This control can be referenced directly by browsing to the control (%SYSDIR%\MSWINSCK.OCX by default). Note: The reference to Microsoft Winsock Control 6.0 (SP6) will only appear as a checked selection in the References list right after the selection is made. Once the References or the Project window is closed, this reference will no longer appear in the list, though the object will still be accessible in the project. Unfortunately, there is a licensing issue which prevents the Winsock control from being properly redistributed. Programs developed using a direct reference to MSWINSCK.OCX will run fine on the development system, or any other system with a design-time developer license installed (any system with Visual Studio or Visual Basic installed), but will not work when redistributed to another client as part of an installation package. When attempting to create the component an unlicensed system will generate the message: Run time error '429': ActiveX component can't create object. The only legal way we have found to get around this issue is to add the control to a form, even a hidden one. The run-time license will then be properly installed with the component. See Microsoft support article 313984 for more details. There are a number of other workarounds proposed, though we do not know if these solutions are within the original licensing agreement. To create a formless component with Winsock capabilities, we recommend using CSocket, a free class replacement for Winsock. Its interface is very similar to MSWINSCK.OCX meaning it is a simple replacement to make for those who may have already attempted to implement a formless component MSWINSCK.OCX: one method's and six events' names change very slightly. As a side benefit, you are including source code instead of a compiled component, which can greatly assist troubleshooting. Author: ASAK Created: Nov 17 2005 (last modified Feb 12 2006) Categories: Visual Basic TechByte #86 Warning: By visiting this site and/or by using any information contained herein, you agree to the Techbytes.ca terms of use. Add a comment about this TechByteIf you wish to add a comment regarding this TechByte, please use the form below. Please note that by submitting comments using this form you are allowing all of the information submitted to be visible on this website. Any comments submitted using this form will only be shown on the website if they are approved by the administrators of this site. IF APPROVED, COMMENTS MAY TAKE SEVERAL DAYS TO BE POSTED. Other TechBytes: |
|

