Chat program - user list (help!)

Started by
-1 comments, last by ukdeveloper 19 years, 3 months ago
Hi, I'm working on a chat program in VB6. I want to have a dynamically updating user list that updates whenever a client enters/leaves the room. If a client joins/leaves the room, then the current list of who's in there, up to date, should be transmitted to them. Any thoughts on how that would be achieved? Also, I'm having trouble with some code on my server app (client and server are separate apps). When a user joins the room, their name is added to an array called handles(). I want to add their name to a dropdown list (combobox) called lstUsers, but only if it isn't there already. lstUsers is not part of a control array, and here's the broken code:

For X = 0 To UBound(handles)

    If frmMain.lstUsers.Text(X) <> username And frmAdminMessage.lstUsers.Text(X) <> username Then
    
    frmMain.lstUsers.AddItem username  'variable username is extracted from a received string using the Split function
    
    frmAdminMessage.lstUsers.AddItem username 'same here
    
    End If

Next X

I get an error saying "Wrong number of arguments or invalid property assignment" when a client tries to connect, and the debugger highlights the ".Text" part of my first add line. Please help me, this is really starting to irritate me because it should be a simple bug to fix.

This topic is closed to new replies.

Advertisement