다음을 통해 공유


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.

Remarks

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

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

Requirements

Header: afx.h

See Also

Concepts

CMemFile Class

CMemFile Members

Hierarchy Chart

CMemFile::Attach