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.
CArchive::ReadObject
CArchive                                    Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Protected: CObject* ReadObject( const CRuntimeClass* pClass )
  throw( CFileException, CArchiveException, CMemoryException );
 
  Parameter   Description
 
  <pClass>    A constant pointer to the CRuntimeClass structure that
              corresponds to the object that you expect to read.
 
  Remarks
 
  Reads object data from the archive and constructs an object of the
  appropriate type. If the object contains pointers to other objects,
  those objects are constructed automatically.
 
  This protected function is normally called by the public CArchive
  extraction (>>) operator, overloaded for a CObject pointer. ReadObject,
  in turn, calls the Serialize function of the archived class.
 
  If you supply a nonzero <pClass> parameter, which is obtained by the
  RUNTIME_CLASS macro, then the function verifies the run-time class of
  the archived object. This assumes you have used the IMPLEMENT_SERIAL
  macro in the implementation of the class.
 
  Return Value
 
  A CObject pointer that must be safely cast to the correct derived class
  by using CObject::IsKindOf.
 
  See Also
 
  CArchive::WriteObject, CObject::IsKindOf
 
 
                                     -♦-