visual basic chat client
ok, i''m trying to make a chat thing in VB, but it won''t work (why else would i be posting here)
i basically used the code from Microsoft''s website, with a few modifications. here it is:
Private Sub Form_Load()
'' The control''s name is udpPeerA
With udpPeerA
'' IMPORTANT: be sure to change the RemoteHost
'' value to the name of your computer.
.RemotePort = 1001 '' Port to connect to.
.Bind 1002 '' Bind to the local port.
End With
End Sub
Private Sub mnuConnect_Click()
udpPeerA.RemoteHost = InputBox("enter IP address for computer you wish to chat with:", "make connection")
End Sub
Private Sub txtSend_Change()
'' Send text as soon as it''s typed.
udpPeerA.SendData txtSend.Text
End Sub
Private Sub udpPeerA_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
udpPeerA.GetData strData ''i get an error here
txtOutput.Text = strData
End Sub
winsockvb.com
=)
Lord Hen
EDIT: In the code you posted, you never even try to connect...
mnuConnect_Click should have this line:
or something...
[edited by - Lord Hen on July 28, 2003 4:08:46 PM]
=)
Lord Hen
EDIT: In the code you posted, you never even try to connect...
mnuConnect_Click should have this line:
udpPeerA.connect
or something...
[edited by - Lord Hen on July 28, 2003 4:08:46 PM]
quote:Original post by Lord HenSeeing as he''s using UDP, no.
EDIT: In the code you posted, you never even try to connect...
mnuConnect_Click should have this line:udpPeerA.connect
or something...
"For crying out loud, she has fishes coming out of her head on either side. How can you find this hot?!"
"If anyone sees a suspicious, camouflaged factory being carried across the desert, they should report it immediately."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement