CMemFile::CMemFile

CMemFile( UINT nGrowBytes = 1024 );

CMemFile( BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0 );

Parameters

nGrowBytes

The memory allocation increment in bytes.

lpBuffer

Pointer to a buffer that receives information of the size nBufferSize.

nBufferSize

An integer that specifies the size of the file buffer, in bytes.

Remarks

The first overload opens an empty memory file. Note that the file is opened by the constructor and that you should not call CFile::Open.

The second overload acts the same as if you used the first constructor and immediately called Attach with the same parameters. See Attach for details.

Example

// example for CMemFile::CMemFile
CMemFile f; // Ready to use - no Open necessary.

BYTE * pBuf = (BYTE *)new char [1024];
CMemFile g( pBuf, 1024, 256 );
// same as CMemFile g; g.Attach( pBuf, 1024, 256 );

CMemFile OverviewClass MembersHierarchy Chart

See Also   CMemFile::Attach