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.
CObject::IsKindOf
CObject                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  BOOL IsKindOf( const CRuntimeClass* pClass ) const;
 
  Parameter   Description
 
  <pClass>    A pointer to a CRuntimeClass structure associated with your
              CObject-derived class.
 
  Remarks
 
  IsKindOf tests this object to see if (1) it is an object of the
  specified class or (2) if it is an object of a class derived from the
  specified class. This function only works for classes declared with the
  DECLARE_DYNAMIC or DECLARE_SERIAL macros.
 
  Do not use this function extensively because it defeats the C++
  polymorphism feature. Use virtual functions instead.
 
  Return Value
 
  TRUE if the object corresponds to the class; otherwise FALSE.
 
  Example
 
  CAge a(21); // must use IMPLEMENT_DYNAMIC or IMPLEMENT_SERIAL
  ASSERT( a.IsKindOf( RUNTIME_CLASS( CAge ) ) );
  ASSERT( a.IsKindOf( RUNTIME_CLASS( CObject ) ) );
 
 
  See Also
 
  CObject::GetRuntimeClass, RUNTIME_CLASS macro
 
 
                                     -♦-