Solved

Adding Virtual Memory To Multiline Listbox or RichEdit

Posted on 1997-04-17
2
228 Views
Last Modified: 2013-12-04
null
0
Comment
Question by:pollarda
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…

696 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