Click to See Complete Forum and Search --> : How to add Microsoft WinSock controll to webform??


soup
April 4th, 2004, 04:17 AM
Hi all,

Had some really weird problems with VS .NET on the main computer, so on installing VS .NET on my laptop tried developing some Window Forms (VB .NET). However on trying to add a Winsock to the form, could not find it in the "Windows Forms" toolbox. Then on remembering on my main computer that I had to add the MSWINSCK.OCX from "C:\Windows\System32" directory, tried to find it on the laptop drvie, but was not there!! So imported the file from my main computer and was able to install it in the "Windows Forms" toolbox on the laptop. Yet on trying to add the Winsock into the form, I recieve the following error:
"You do not have a license to use this ActiveX control"

So I registered the file using regsvr32, but now when I try adding the Winsock to the form,, it now says:
"You do not have a license to use this activX control"

Both computers are Windows XP pro and up to date.

Any one know how I can by pass this error???
TIA.

soup
April 4th, 2004, 07:04 AM
Ok, Have found the problem, aparently Winsock is a VB6 thing.
As I had installed VB6 on my main computer previously, the .NET version picked it up and worked fine. On the laptop I had never installed VB6, it ws just a matter of using a registry file supplied with the .NET CD. Details at:

http://support.microsoft.com/default.aspx?kbid=318597&product=vbNET

Cheers.

nicepat
April 6th, 2004, 06:05 PM
Yes I agree with the last commenter.
And I found that we should have 'references' in the project.
In order to use winsock, we need System.Net.Winsock reference added in my project. And I can create a socket object like this,

Dim s As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)

However, I am looking for a complete sample for UDP and TCP things....

Any help ?


Ju-Hyoung

nicepat
April 6th, 2004, 07:18 PM
I found two samples from MSDN. They are in VB 101 examples package. There are Server side and Client side implementation. But they are not winsock object use.

nicepat
April 8th, 2004, 03:09 PM
FYI

fromthesqlhell
November 27th, 2004, 05:47 AM
for the register vb6 controls >>>
(copy from http://support.microsoft.com/?kbid=318597)

/***************************************************************/

1. Insert the Visual Studio .NET Installation Disk that has the \Extras\VB6 Controls folder in the in the CD-ROM or in the DVD-ROM drive. The following list describes what disk to use for each product edition on CD-ROM:

Visual Studio .NET 2002 (not the Microsoft Developer Network [MSDN] disk) • All Enterprise Editions - Disk 4
• Professional Edition - Disk 4
• Standard Edition - Disk 3
• Academic Edition - Disk 4
Visual Studio .NET 2003 (not the MSDN disk) • All Enterprise Editions - Disk 2
• Professional Edition - Disk 2
• Standard Edition - Disk 1
• Academic Edition - Disk 2

2. Click Start, and then click Run.
3. In the Run dialog box, type regedit, and then click OK.
4. In the Registry Editor dialog box, click Import on the File menu.
5. Locate the \Extras\VB6 Controls folder on your Visual Studio .NET Installation CD-ROM, select the VB6Controls.reg file, and then click Open. This inserts all of the Visual Basic 6.0 ActiveX Controls license keys in the registry.

/**********************************************************/