Results 1 to 5 of 5

Thread: Run Time Error 40020!! Pls Help!

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    3

    Question Run Time Error 40020!! Pls Help!

    I have write a simple Client/Server program, for multiple client within my home. But when I run the client program, It give me the following Error.

    Run Time Error 40020!

    My code is below, THanks For your help in advance!
    VB Code:
    1. Option Explicit
    2. Private Sub cmdClose_Click()
    3. Socket1.Close
    4. StatusBar1.Panels(1).Text = "Connection Closed"
    5. End Sub
    6.  
    7. Private Sub cmdConnect_Click()
    8. If Socket1.State <> sckClosed Then
    9.     Socket1.RemoteHost = "192.168.0.4"
    10.     Socket1.RemotePort = 1007
    11.     Socket1.Connect
    12.     txtSend.SetFocus
    13.     StatusBar1.Panels(1).Width = 1000
    14.     StatusBar1.Panels(1).Text = "Connecting to server..."
    15. Else
    16.     MsgBox "Error! Connection already exist, Please Close connection before Connect!"
    17. End If
    18. End Sub
    19.  
    20. Private Sub Form_Load()
    21. Socket1.Connect
    22. End Sub
    23.  
    24.  
    25. Private Sub txtSend_KeyPress(KeyAscii As Integer)
    26. Static Last_Line_Feed As Long
    27. If Socket1.State <> sckConnected Then
    28.     Dim NewLine As String
    29.     If txtSend = vbNullString Then Last_Line_Feed = 0
    30.     If KeyAscii = 13 Then
    31.     NewLine = Mid(txtSend, Last_Line_Feed + 1)
    32.     Last_Line_Feed = txtSend.SelStart
    33.     End If
    34.     StatusBar1.Panels(1).Text = "Sending Data..."
    35.     Socket1.SendData txtName.Text & " >" & NewLine
    36.     DoEvents
    37. Else
    38.     StatusBar1.Panels(1).Text = "Not Currently Connected!"
    39. End If
    40. End Sub
    41.  
    42. Private Sub Socket1_DataArrival(ByVal bytesTotal As Long)
    43. Dim data As String
    44. Socket1.GetData data, vbString
    45. txtReceive.SelText = data
    46. End Sub
    47.  
    48. Private Sub Socket1_SendComplete()
    49. StatusBar1.Panels(1).Text = "Complete Sending Process!"
    50. End Sub

    The stops at [Socket1.RemoteHost = "192.168.0.4"]
    anyone can help!!!
    Last edited by Locus; Jan 16th, 2006 at 08:39 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width