|
-
Sep 28th, 2005, 03:46 PM
#1
Thread Starter
Member
Adding Nickname to Listbox[VB6]
Hi, is there any way to do this?
» Send a simple a name like "David" to the server and come back to the client insidea listbox? I have multiple connections running and I don't want IP addresses showing for security reasons....
» So it will be like when someone connects to the server it sends the nickname they put in a textbox to the server and come back to the client inside a listbox.
Thank You,
EnYcE
-
Sep 28th, 2005, 06:30 PM
#2
Re: Adding Nickname to Listbox[VB6]
Yes it is possible and there is not set way to do it, what you must think about is what is the logical way to do it?
You know how to send/recieve data so you need to determine a way to seperate usernames from chat, I personally would prefix the usernames with ¬ or somthing, then on recieving any data check that first character, if you have a look at any of the many examples I have posted here you will see this in action 
Its one of them questions which doenst really have a ana nswer
Pino
-
Sep 28th, 2005, 07:16 PM
#3
Thread Starter
Member
Re: Adding Nickname to Listbox[VB6]
Hi, can you give me a name of the example you are talking about. Will be much easier to find it 
Thanks,
EnYcE :coo:
-
Sep 28th, 2005, 08:42 PM
#4
Thread Starter
Member
Re: Adding Nickname to Listbox[VB6]
SOrry for double post...
But just wondering is it also possible to connect on a different form and then have another form connected as well to the server at the same time?
For example, in my program I'm trying to do this:
Connect on a form and then show a button to go to a different form where you can chat. But it always says that i'm not connected when I get to the chat form.
Thanks,
EnYcE
-
Sep 29th, 2005, 10:01 AM
#5
Re: Adding Nickname to Listbox[VB6]
 Originally Posted by EnYcE
SOrry for double post...
But just wondering is it also possible to connect on a different form and then have another form connected as well to the server at the same time?
For example, in my program I'm trying to do this:
Connect on a form and then show a button to go to a different form where you can chat. But it always says that i'm not connected when I get to the chat form.
Thanks,
EnYcE
How are you connecting on your first form?
-
Sep 29th, 2005, 04:32 PM
#6
Thread Starter
Member
Re: Adding Nickname to Listbox[VB6]
Well i have a connect button which does Winsock.Connect and I get connected then a button comes up for ENter Chat. Then when you click that button i do this, Form2.show. Then on my 2nd form I have all the DataArrival and Send stuff. Here's the code:
Code:
First Form:
Private Sub cmdConnect_Click()
Winsock.RemoteHost = txtHost.Text
Winsock.RemotePort = 10185
Winsock.Connect
lblConnect = "Connecting...."
cmdConnect.Enabled = False
cmdClose.Enabled = True
End If
End Sub
Private Sub Winsock_Connect()
lblConnect = "Connected to " & txtHost.Text & "."
txtNick.Enabled = False
cmdConnect.Enabled = False
cmdEnter.Visible = True
cmdEnter.Enabled = True
End Sub
Second Form:
DataArrival.......Send.........etc..
Hope this is what you asked for....
-
Oct 19th, 2005, 10:56 AM
#7
New Member
Re: Adding Nickname to Listbox[VB6]
Your winsock object is on your first form, not on your second. You cannot simply do something like Winsock.SendData txtChat.Text or something on your 2nd form, because the object isnt on the 2nd form -- try Form1.Winsock.SendData txtChat.Text -- where Form1 is the name of your first form. This way you are pointing to the winsock object on the other form, and not making visual basic think it's looking for an object called "Winsock" on your 2nd form. Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|