if (lpMapAddress == NULL)
{
ErrorHandler("Could not map view of file.");
}
========================================================================
HANDLE hMapFile;
LPVOID lpMapAddress;
hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, // Read/write permission.
FALSE, // Do not inherit the name
"MyFileMappingObject"); // of the mapping object.
if (hMapFile == NULL)
{
ErrorHandler("Could not open file-mapping object.");
}
lpMapAddress = MapViewOfFile(hMapFile, // Handle to mapping object.
FILE_MAP_ALL_ACCESS, // Read/write permission.
0, // Max. object size.
0, // Size of hFile.
0); // Map entire file.
if (lpMapAddress == NULL)
{
ErrorHandler("Could not map view of file.");
}
另外还有几个有关的函数俺就不多说了,具体看一下MSDN吧!
希望对你有所帮助!