I know I said "next week when I get some spare time", but
there were no good movies on TV so I had a little tinker
with the Memory Mapped Files.

Where I think they will be useful (in general) is:
Speed: Less than 100ms to map then file as Memory.
Sharing: Different applications can share the memory
(which happens to be stored in a file).

Where I think it could help those applications where large
files are involved is that you would not need to load the
entire file into memory. This is a bad idea in general
unless you know that your file is always less than a
certian limit. But even then, what if your file is 1GB is
size. Will you ensure you have enough memory (Real and
virtual) to load the file? I think not. I also seriously
doubt that your user would enjoy waiting for a 1GB file to
be read if all he wanted to do was to search for a sequence
of characters.

So, if the only reason balip (or whoever else is
interested) loads the file into memory (in a string) is to
use InStr, then I suspect that a far far better idea is to
use the memory mapped file idea, write or find a dll that
allows you to find a byte sequence in a given memory range
(in fact I am 100% certain this will be built in to
win32API - will take a look soon). Another function needed
is to extract a string from between two memory addresses
(like Mid does already).

Even if you don't do all this, you need to consider using a
byte array for your project instead of building a string.
This is simply because a string of say 1000 characters is
stored internally as unicode which makes it 2000 bytes.

You immediately save 50% of your storage space by using a
byte array instead of a string. The only sacrifice is that
you have less access to some pre-defined VB string handling
code.

If anyone is interested in the sample project I wrote then
email me at [email protected]. This sample is very
simple and uses the api calls to tell VB that a disk file
is REALLY some memory belonging to my application.

The lessons I followed to learn this technique are from Dan
Appleman's Win32 API book which I think every VB developer
must have (or have access to).

Regards