Export (0) Print
Expand All

CMemFile::CMemFile 

The first overload opens an empty memory file.


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.

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 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 );

Community Additions

ADD
Show:
© 2015 Microsoft