Winsock Problem 
Author Message
 Winsock Problem

Hello,

I am new to VB6 and am trying to construct the basic winsock example
in VB but I keep getting the same error, when I try to run it.
Basically it says:

Runtime error 424, object required.

and points to the line - tcpClient.RemoteHost = "127.0.0.1"

have altered this line from the localhost name to the friendly PC name
but still have the same error.

I would much appriciate any help with this, as I can't find a solution
in the help files. Source code follows.

Robert Stevenson

Private Sub Form_Load()
' The name of the Winsock control is tcpClient.
' Note: to specify a remote host, you can use
' either the IP address (ex: "121.111.1.1") or
' the computer's "friendly" name, as shown here.
tcpClient.RemoteHost = "127.0.0.1"
tcpClient.RemotePort = 1001
End Sub

Private Sub cmdConnect_Click()
' Invoke the Connect method to initiate a
' connection.
tcpClient.Connect
End Sub

Private Sub txtSendData_Change()
tcpClient.SendData txtSend.Text
End Sub

Private Sub tcpClient_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
tcpClient.GetData strData
txtOutput.Text = strData
End Sub



Fri, 02 Apr 2004 22:06:58 GMT  
 Winsock Problem
Sounds strange to just make the connect call with

tcpClient.Connect "127.0.0.1", 1001

That works for me.

- Henning



Quote:
> Hello,

> I am new to VB6 and am trying to construct the basic winsock example
> in VB but I keep getting the same error, when I try to run it.
> Basically it says:

> Runtime error 424, object required.

> and points to the line - tcpClient.RemoteHost = "127.0.0.1"

> have altered this line from the localhost name to the friendly PC name
> but still have the same error.

> I would much appriciate any help with this, as I can't find a solution
> in the help files. Source code follows.

> Robert Stevenson

> Private Sub Form_Load()
> ' The name of the Winsock control is tcpClient.
> ' Note: to specify a remote host, you can use
> ' either the IP address (ex: "121.111.1.1") or
> ' the computer's "friendly" name, as shown here.
> tcpClient.RemoteHost = "127.0.0.1"
> tcpClient.RemotePort = 1001
> End Sub

> Private Sub cmdConnect_Click()
> ' Invoke the Connect method to initiate a
> ' connection.
> tcpClient.Connect
> End Sub

> Private Sub txtSendData_Change()
> tcpClient.SendData txtSend.Text
> End Sub

> Private Sub tcpClient_DataArrival _
> (ByVal bytesTotal As Long)
> Dim strData As String
> tcpClient.GetData strData
> txtOutput.Text = strData
> End Sub



Sat, 03 Apr 2004 00:53:16 GMT  
 Winsock Problem
Here I go again, the message should have read:

Have you ever tried to just make the connect call with

tcpClient.Connect "127.0.0.1", 1001

Sorry for the mess, Henning



Quote:
> Sounds strange to just make the connect call with

> tcpClient.Connect "127.0.0.1", 1001

> That works for me.

> - Henning



> > Hello,

> > I am new to VB6 and am trying to construct the basic winsock example
> > in VB but I keep getting the same error, when I try to run it.
> > Basically it says:

> > Runtime error 424, object required.

> > and points to the line - tcpClient.RemoteHost = "127.0.0.1"

> > have altered this line from the localhost name to the friendly PC name
> > but still have the same error.

> > I would much appriciate any help with this, as I can't find a solution
> > in the help files. Source code follows.

> > Robert Stevenson

> > Private Sub Form_Load()
> > ' The name of the Winsock control is tcpClient.
> > ' Note: to specify a remote host, you can use
> > ' either the IP address (ex: "121.111.1.1") or
> > ' the computer's "friendly" name, as shown here.
> > tcpClient.RemoteHost = "127.0.0.1"
> > tcpClient.RemotePort = 1001
> > End Sub

> > Private Sub cmdConnect_Click()
> > ' Invoke the Connect method to initiate a
> > ' connection.
> > tcpClient.Connect
> > End Sub

> > Private Sub txtSendData_Change()
> > tcpClient.SendData txtSend.Text
> > End Sub

> > Private Sub tcpClient_DataArrival _
> > (ByVal bytesTotal As Long)
> > Dim strData As String
> > tcpClient.GetData strData
> > txtOutput.Text = strData
> > End Sub



Sat, 03 Apr 2004 00:58:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. winsock problem sending large strings (winsock.senddata)

2. Winsock Problem

3. .NET Socket vs VB6 Winsock problem!

4. winsock problems

5. Simple WINSOCK Problem

6. Simple Winsock Problem

7. Winsock Problems

8. VB5: winsock problem

9. Visual Basic 6 Winsock Problem

10. Winsock Problem

11. VB6 Winsock Problem

12. odd winsock problem

 

 
Powered by phpBB® Forum Software