Friday, April 06, 2007

How to use Memory Mapped file

First, you have to open that file

CreateFileForMapping

then create the memory mapped file object, you can give a name to this file-mapping object.

CreateFileMapping

Map the object into the address space of calling function

MapViewOfFile

Now you can deal with the file as dealing with a memory space.

When you finish, you have to unmaps a mapped view of a file from the address space of the calling process

UnmapViewOfFile

and close the file-mapping object and the file using

CloseHandle

No comments: