|
-
Feb 1st, 2001, 07:29 AM
#1
Thread Starter
New Member
Help, help help, that's all I can say.
Well, i'll give you a little more than that.
I want to create a Communications Class which has a self contained Winsock object. To do this, I have created a reference by selecting, Project|References|Browse... and then selected the WSOCK32.OCX from the Windows\System directory. The Communications Class looks like this
Dim WithEvents Socket as Winsock
Private Sub Socket_ConnectionRequest(ByVal requestID As Long)
Socket.Accept requestID
End Sub
Private Sub Class_Initialize()
Set Socket = New Winsock
Socket.LocalPort = 9000
Socket.Listen
End Sub
Then in the declarations part of the FORM
Dim Comm as CommunicationsClass
Private Sub Form_Load()
Set Comm = New CommunicationsClass
End Sub
When you run this, and connect to the server using Windows Telnet (telnet.exe) and connect to the localhost (which can be retrieved by MsgBox Socket.LocalHostName in the Classes Initialize Event (after Set command))
I keep getting this error message (40020) something like operation unavailable at current state. Can you please Send ANY Information to [email protected] since I'm not sure if I can get back to this forum (at Uni, and they like to BAN pages).
The reason I want to do this is so that I don't have to make the Class back reference to a form with the Winsock Control.
Any information would be very helpful, i'm exhausted all my other sources of information, even the Microsoft site wasn't much help)
Cheers all,
Matt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|