Hi all,
I'm trying to understand MMF's - My idea is a batch process that builds a file in memory and then flushes the lot to disk on completion.
Now I'm new to MMF's so I'm probably missing something (like THE POINT!
)
Could someone try to explain what I'm doing wrong in the Psuedo below...
[psuedo]
sFile = "C:\whatever.txt"
FileHandle = CreateFile(sFile...
Call WriteFile(FileHandle,... 'write a few bytes
Call FlushFileBuffers(FileHandle) 'flush the bytes to disk
MappingHandle = CreateFileMapping(FileHandle, Security, PAGE_READWRITE, 0, 0, sFile & "map")
MappingAddress = MapViewOfFile(MappingHandle,...
Do
ProcessSomething
Call WriteFile(MappingHandle,...'Fails (BytesWrittten=0)
Loop Until Whatever
' Flush the lot at once
FlushViewOfFile MappingHandle, 0
Call FlushFileBuffers(MappingHandle)
Call FlushFileBuffers(FileHandle)
[/psuedo]
TIA !
I'm trying to understand MMF's - My idea is a batch process that builds a file in memory and then flushes the lot to disk on completion.
Now I'm new to MMF's so I'm probably missing something (like THE POINT!
Could someone try to explain what I'm doing wrong in the Psuedo below...
[psuedo]
sFile = "C:\whatever.txt"
FileHandle = CreateFile(sFile...
Call WriteFile(FileHandle,... 'write a few bytes
Call FlushFileBuffers(FileHandle) 'flush the bytes to disk
MappingHandle = CreateFileMapping(FileHandle, Security, PAGE_READWRITE, 0, 0, sFile & "map")
MappingAddress = MapViewOfFile(MappingHandle,...
Do
ProcessSomething
Call WriteFile(MappingHandle,...'Fails (BytesWrittten=0)
Loop Until Whatever
' Flush the lot at once
FlushViewOfFile MappingHandle, 0
Call FlushFileBuffers(MappingHandle)
Call FlushFileBuffers(FileHandle)
[/psuedo]
TIA !