Results 1 to 2 of 2

Thread: Handling large (binary) files

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    3
    Hello VBWorld browsers,

    I'm writing an application that use binary files as input. The files are quite big (>100MB) and the internal data types quite small (8 bytes each). This takes hours to browse through all the records due to the many "get" actions.
    The solution would be to read the file in memory in big chunks first.
    Before starting to write the code for that I wonder if anyone out there has done this already.
    I heard that in C, there is a "memfile" function that aut. takes care of loading the file in memory. Does this (or something similar) exists in VB 6.x as well? that would be even easier and, probably, much faster as well.

    hope to hear from anyone soon,

    Regards,

    Walter De Jean (Belgium)

  2. #2
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    Try looking up the CreatFileMapping and MapViewOfFileEx api functions. These functions allow you to operate on the memory directly as if it was in your application's workspace (very fast) and use asynchronous operations to allow you do one thing while waiting for another. For example, you could retrieve data from a file and at the same time clear all the controls on your form.

    Go to http:\\www.vbapi.com for help on these and their related functions.

    Hope this helps.

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