Results 1 to 4 of 4

Thread: Filesystem Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    Pakistan
    Posts
    388

    Post 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?

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Filesystem Question

    Quote 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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    Pakistan
    Posts
    388

    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.

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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
  •  



Click Here to Expand Forum to Full Width