chat app

Dolecolia
02-06-2002, 08:19 PM
Hey I want to make a chat App for me and one other person but the one in the msdn library the upd one or watever i always get errors on so if ne one can help me here im kinda new to vb but i know some things

Spike
02-06-2002, 08:22 PM
You can use TCP/IP option of winsock.
You can check out http://www.planetsourcecode.com for examples, just search for "Winsock Chat"
There are probably examples on this forum too, just use the search feature.

Dolecolia
02-06-2002, 08:30 PM
i already did they arent of much help




totaly un related to topic i listen to slipknot to lol

usetheforce2
02-06-2002, 09:19 PM
check out the Chiefs post!

Click here for chat demo (http://visualbasicforum.com/showthread.php?s=&threadid=17687)

good luck

Dolecolia
02-07-2002, 06:46 AM
yeah i got that but i cant seem to get it to work il try dinking around maybe i have to change something or somethin like do both people have to have that program on then they just send stuff to eachother?

orufet
02-07-2002, 08:03 AM
I can't read what your question is, but it would work just like any other chat program. Both people need it open, and both people need to be connected to the internet at the same time.

ChiefRedBull
02-07-2002, 08:55 AM
OK, quick lesson on theory of the internet......

Basically, everything is done via IP. TCP is laid on top of that, and thats what we use for chat apps. Luckily though, the Winsock control deals with all the nasty stuff, so all we have to do is establish a connection. (Hey, I said it was gonna be a quick lesson... :))

Both computers need to have the chat software, both need to be connected to the internet, and one needs the others IP address. If you dont know how to get your IP address, then do this:
Click Start-->Run... and type "winipcfg" (without the quotes). Your IP address is shown in the window that pops up.

OK, quick Winsock lesson.....

One winsock will "Listen" for incoming connections, and when they arrive, it will accept them, thus establishing a direct link between the two computers.
The other winsock (on the other computer) requests the connection.
Heres a VERY basic demo. You'll need 2 forms, each with a winsock control. (For a slightly less basic but still very simple example, read through my tutorial a few more times)
FORM 1 - on your computer.
Private Sub Form_Load()
Winsock1.LocalPort = 12345
Winsock1.Listen
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim StrData As String
Winsock1.GetData StrData
MsgBox StrData
End Sub
FORM 2 - on the other computer
Private Sub Form_Load()
Winsock1.Connect "your IP here", 12345
End Sub

Private Sub Command1_Click()
If Winsock1.State = sckConnected Then
Winsock1.SendData "hello friend."
End If
End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum