Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

instancing a Winsock Control WITHEVENTS on NT Server

Status
Not open for further replies.

klotzt

Programmer
Dec 15, 2000
4
US
Dim WithEvents a As MSWinsockLib.Winsock

Private Sub Form_Load()

Set a = New MSWinsockLib.Winsock

End Sub


Can anyone tell me why this bit of VB code works on every win95/win98 and win nt4 workstation i can find, but gives a 429 error whenever it is run under any NT4 Server?
 
Do you have the mswinsck.ocx on the NT machine? I use the winsock control on NT all the time. I have SP5 installed with Visual Studio SP3. Snaggs
tribesaddict@swbell.net
Experience is what you get when you didn't get what you wanted.
 
Yep, the winsock control is installed on all of our NT servers. I would point out that it works fine on NT workstation, i only have problems with it on NT server SP6. What i can do is put the control on a form and use it, howerver that will not work for what i am doing. that works fine. I run into a problem when I dim it using withevents. It works fine under 95/98 and under NT workstation, its only when its run under NT server that it gives me the 429 error
 
I might make a recommendation then. There is a company called Catalyst Software that makes a FREE winsock control. It blows the doors off the MSWINSCK.OCX control as far as performance and functionality. They provide several examples of using the control to do FTP and general Chat programs and things like that. This is the control that I used for all my applications that worked with sockets. I did set a reference to the control and then declared a variable using WithEvents and the control did run fine on Window NT Server. I basically put the reference in a COM DLL and then wrote a wrapper Class around the OCX. This way the other objects I had in the DLL could use the CWinsock Wrapper class to do all the communication. I had SendData and ReceiveData routines that created the CWinsock class and took care of all the creation/destruction and connecting/disconnecting inside of it. This made the socket implementation totally transparent to the user of the objects in the DLL. I do belive the server had SP5 or 6a on it. Here's a link for the socket control.


They also offer some very good code and examples of how to use it to do different things. Here's a link to that.


Good luck! Snaggs
tribesaddict@swbell.net
If a parsley farmer is sued, can they garnish his wages?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top