Compartilhar via


CMemFile::Detach

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

BYTE * Detach( );

Return Value

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

Remarks

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.

Requirements

Header: afx.h

See Also

Reference

CMemFile Class

Hierarchy Chart

CMemFile::Attach

CFile::GetLength

Other Resources

CMemFile Members