# Basic problem with Winsock control



## TheAtheist (May 20, 2006)

Hi, i've just got back into using Vb 6.0 after a long absence. Followed a tutorial on the net for some small chat program, with both a client and a server part. Alls good so far until i get the following error

"RunTime 424.

Object required"


On the server it works fine, except i get a rutime error 40006 on it when trying to send stuff due to not having the client working. 

Here is the code for the client side


```
Private Sub cmdConnect_Click()
 sockMain.RemoteHost = txtHost.Text
   sockMain.RemotePort = txtPort.Text
   sockMain.Connect
End Sub

Private Sub cmdSend_Click()
  sockMain.SendData txtSend.Text
End Sub

Private Sub sockMain_DataArrival(ByVal bytesTotal As Long)
   Dim strData As String
    
   sockMain.GetData strData, vbString
   txtStatus.Text = txtStatus.Text & _
      strData & vbCrLf
End Sub
```
I get no defining errors elsewhere, only when i try to connect on the client side. cheers for any help. anything else needed i can attach.


----------

