|
-
Feb 13th, 2008, 02:35 AM
#1
Thread Starter
Hyperactive Member
Filesystem Question
I want to ask if dealing with binary files is different in win98 and winXP because a program that I wrote in VB6 under win98 environment does not work under WinXP. It is about reading a binary file, diving it into pieces and then sending the pieces via Winsock. It does read the file but it does not make its pieces as it should (using left(), and mid()). Its like this:
Code:
'read the binary file and save data in "data" string variable
dim partoffile as string
partoffile=left(data,8192) 'clipping the first 8 KBs of data
data=mid(data,8193)
winsock.senddata partoffile
Now either winsock does not send the data, or it creates an error or there's a problem with diving the data, because the data "boxes" never reach at the receiving end successfully. Whats wrong?
-
Feb 13th, 2008, 02:51 AM
#2
Re: Filesystem Question
 Originally Posted by lone_REBEL
Now either winsock does not send the data, or it creates an error or there's a problem with diving the data, because the data "boxes" never reach at the receiving end successfully. Whats wrong?
I suspect the problem is at the receiving end. Can you post the DataArrival event code of the receiver please.
-
Feb 13th, 2008, 10:48 AM
#3
Thread Starter
Hyperactive Member
Re: Filesystem Question
Its this:
Code:
Private Function SaveFile(byref newdata as string)
Static data as string
data=data & newdata
End Function
Private Function sk_DataArrival(Byref BytesTotal as Long)
dim data as string
sk.getdata data
SaveFile data
sk.senddata "Send Next Fragment"
End Function
Now the fact is that I coded send a message every time when the file fragment is being sent. And the message is displayed only once (for the start of the file) and never again. I also sent a message every time the data is received and this also displays the message only once! (only one fragment is received). I'm totally lost as to where is the error.
Note that it works absolutely fine under windows 98 and 2000. Only XP has some strange problem with it.
-
Feb 13th, 2008, 12:41 PM
#4
Re: Filesystem Question
The first thing that springs to mind is how does the receiver know when everything has been sent?
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
|