Memory Mapping function MapViewOfFile parameters
Posted on 2001-06-19
I am learning how to memory map a large file...
I can map the entire file to a character buffer as follows just fine using the following call:
lpMMFile = (char *) MapViewOfFile (hInMap,
Parameter 3 is the upper DWORD of the file offset
Parameter 4 is the lower DWORD
Parameter 5 is the number of bytes to transfer
When all three are set to 0, the whole file is mapped to lpMMFile. My program works just fine with these arguments.
I don't know how to use parameters 3 through 5 to select parts of the file into RAM.
Isn't a DWORD an 8 bit binary? I can't make it work.
For example, how would I select the contents starting at offset 20 and load 50 bytes into the char buffer?
My program displays (null).