CMemFile::Detach

BYTE * Detach( );

Return Value

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

Remarks

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

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.

CMemFile OverviewClass MembersHierarchy Chart

See Also   CMemFile::Attach, CFile::GetLength