Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
class CMemFile
CFile                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Description
 
  CMemFile is the CFile-derived class that supports in-memory files. These
  in-memory files behave like binary disk files except that bytes are
  stored in RAM. An in-memory file is a useful means of transferring raw
  bytes or serialized objects between independent processes.
 
  Contiguous memory is automatically allocated in specified increments,
  and it is deleted when the object is destroyed. You can access this
  memory through a pointer supplied by a member function.
 
  #include <afx.h>
 
  Comments
 
  The following CFile functions are not implemented for CMemFile:
 
  ■   Duplicate
 
  ■   LockRange
 
  ■   UnlockRange
 
  If you call these functions on a CMemFile object, you will get a
  CNotSupportedException.
 
  The data member CFile::m_hFile is not used and has no meaning.
 
  Derivation
 
  If you derive a class from CMemFile, you must use the protected
  memory-allocation functions listed above, overriding them as necessary.
  If you need global memory access from the Windows medium model, for
  example, derive a class with the four protected functions overridden.
  Your replacement functions should call the Windows GlobalAlloc family of
  functions.
 
  Public Members
 
  Construction/Destruction
 
  CMemFile   Constructs a memory file using internally allocated
               memory.
 
  ~CMemFile   Closes the memory file, freeing allocated memory.
 
 
                                     -♦-