yongyih
asked on
Help me to solve this winsock problem.
I try to do a program for sharing file. I need to send a list of file name (string) to remote pc.
file is a fileListBox
this is my loop to send data.
For c = 0 To file.ListCount
winsockBrowse.SendData "<File>" & file.List(c)
DoEvents
msgbox "Pause"
Next c
The other side will received these data and add to a list box.
My problem is the data didn't add properly to list box.
something like this happen..
<File>c:\a.txt
<File>c:\b.txt<File>c.txt< File>d.txt ......
<File>c:\z.txt
if i put a message box in the loop, then everything is ok.
How to solve this problem?
file is a fileListBox
this is my loop to send data.
For c = 0 To file.ListCount
winsockBrowse.SendData "<File>" & file.List(c)
DoEvents
msgbox "Pause"
Next c
The other side will received these data and add to a list box.
My problem is the data didn't add properly to list box.
something like this happen..
<File>c:\a.txt
<File>c:\b.txt<File>c.txt<
<File>c:\z.txt
if i put a message box in the loop, then everything is ok.
How to solve this problem?
how abt sending the fileListbox values in an "Array". This way you won't require a loop while sending data. Just send the array with values.
-priya
-priya
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To: priya_pbk
Sending directly an array... it may become too complicated, because the mscomm control maintains only binary and string. There will be conversions, that may lead to unwanted results. Pausing after each chunk of data is also not a good idea. This may take hours on a long list.
Sending directly an array... it may become too complicated, because the mscomm control maintains only binary and string. There will be conversions, that may lead to unwanted results. Pausing after each chunk of data is also not a good idea. This may take hours on a long list.
ASKER
Thank you for your help.
priya_pbk also can solve my problem but performance very slow.
priya_pbk also can solve my problem but performance very slow.
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'and write this in place of msgbox
sleep(2000) 'sleeps for 2 sec
Hope this helps!
-priya