Treeview and other problems

  • Thread starter Thread starter Dan Watson
  • Start date Start date
D

Dan Watson

I applogogise... This isn't a VB.NET issue - but my ISP dosnt give's me
tough love when it comes to just VB newsgroups

here goes:

HI guys... I am having a serious bug with my program called Neowin
Messenger which I have only been able to get around with delay hacks,
which seem to cause more problems than fix. I will try and explain the
problem:

Neowin Messenger works on the TCP Client>Server model. The problem is
always the loading of the 'logged in buddies' onto the treeview control
of the person that is logging in... ie loading everyone that is already
logged in.

The server is sending this to the client that has just logged on

----------
Select Case lstUsers.Text
Case Is <> (tempnick & "¤¶£")

For i = -1 To lstUsers.ListCount

Pause (2)
ServiceSocket(ServiceSocket().UBound).SendData
"USER¤¶£" & lstUsers.List(i)

DoEvents%


Next i
End Select
----------

As you can see, it is going through the lastUsers list line by line
(every logged on buddy is loaded onto a seperate line here) and sending
each line of the lstUsers to the newly logged in client.

I had to stick a Pause in there becuase on slower connections, instead
of the client reciveing the "USER¤¶£" & lstUsers.List(i) line by line,
it clumps it all together, so i needed to put 2 second Pause in there.

This is what the client is doing:

----------
Dim IncomingData As String


Winsock1.GetData IncomingData

func = Split(IncomingData, "¤¶£")(0)
dat = Split(IncomingData, "¤¶£")(1)

If Left(IncomingData, 4) = "USER" Then

frmBuddy.BuddyList.Nodes.Add "MAIN", tvwChild, , (dat), 2, 2
Pause 0.08
End If
----------

I really need to know how to stop this data being clumped together on
slower connections.

What would be ideal I guess.. is to send all of the users at once from
the sever in once line, but being seperated by the "¤¶£", and then on
the client, looping around and adding every user in between "¤¶£" on a
different treeview entry. I cant figure out how to do this though

Thanks for your help in advance
 
maybe try the old VBCRLF?

as in
"USER¤¶£" & lstUsers.List(i) & VbCrLf
instead of pauses?

hope this helps

JM
 
Back
Top