Solved

Adding Virtual Memory To Multiline Listbox or RichEdit

Posted on 1997-04-17
2
226 Views
Last Modified: 2013-12-04
null
0
Comment
Question by:pollarda
2 Comments
 
LVL 2

Accepted Solution

by:
amartin030297 earned 100 total points
ID: 1334627
The best approach to resolve your problem is to use memory-mapped files.
The Win32 API functions you'll need to research are:
  CreateFile
  MapViewOfFile
  CloseHandle

Also, "Advanced Windows" by Jeffery Richter will help you if you need further research.

Here's the idea of how it works:
 you "CreateFile" (which doesn't create a new file, but creates a file handle which represents a file). This handle returned to you is VERY fast (sub millisecond).  You can open an existing file (which is probably what you are doing..
  You can then later pass the HANDLE returned by CreateFile to MappedViewOfFile.  Returned from this function is a POINTER which represents the file as IF it were in memory.  This is also a VERY fast call.  ** Note:  Nothing is actually in memory at this point, but you do have a linear pointer to memory for the size you told mappedviewoffile to use.

You can then use that pointer as if you had the whole file in memory.. (functions like strrev for instance) ANY function which uses a pointer can use that pointer... The VMM system will automagically map in your file in 4k pages behind the scene..and map-out unused onces... Thus you can page though a file easily, from any point.

You can also obtain more info at:
   http://lonestar.texas.net/~amartin/free.html
file: RADFILE.ZIP, password:  BETARADFILE4  (or BETARADFILE2)

0
 

Author Comment

by:pollarda
ID: 1334628
Edited text of question
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question