This documentation is archived and is not being maintained.


Call this function to get a pointer to the memory block being used by CMemFile.

BYTE * Detach( );

A pointer to the memory block that contains the contents of the memory file.

Calling this function also closes the CMemFile. You can reattach the memory block to CMemFile by calling Attach. If you want to reattach the file and use the data in it, you should call CFile::GetLength to get the length of the file before calling Detach. Note that if you attach a memory block to CMemFile so that you can use its data (nGrowBytes == 0), then you won't be able to grow the memory file.