Solved

Adding Virtual Memory To Multiline Listbox or RichEdit

Posted on 1997-04-17
2
223 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now