CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15

Threaded View

  1. #3
    Join Date
    Aug 2003
    Posts
    938

    Re: Working with large files.

    Say i have a 1 GB file (text file or something), and i wanna read it. I use scroll view with custom drawing to show the data as i scroll though the file. Now i can't really read in 1 GB file and draw it into CView when i need to. So i load 1 MB chunks of it, and display that until the user scrolls to the bottom of the chunk at which point i load the new chunk.

    Thats the general idea. If you have another idea on how to do that without file mapping it would be great.

    BTW, i wanted to add a seamless ability to edit the file...so file mapping worked pretty well here too.

    The problem with this is to find the most efficient way of loading the next/previous chunk. Keep it as one chunk mapped? Or map 3 overlapped file chunks?

    I am basically looking for suggestions on what would be the most effective way to do this. Right now i am liking the 3 chunks method, sure a bit more memory usage, but the drawing can be seamless, and the only case when there will be a pause is when the user jumps to some location in a file and i have to reload all 3 chunks (shouldn't happen too often).
    Last edited by Quell; June 4th, 2008 at 12:28 PM.

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

Featured