Solved

Adding Virtual Memory To Multiline Listbox or RichEdit

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

914 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

20 Experts available now in Live!

Get 1:1 Help Now