CRuntimeClass is a structure you can use to obtain information about an object or its base class at run time. The ability to determine the class of an object at run time is useful when extra type checking of function arguments is needed, or when you must write special-purpose code based on the class of an object. Each class derived from CObject is associated with a CRuntimeClass structure.
struct CRuntimeClass
{
LPCSTR m_lpszClassName;
int m_nObjectSize;
UINT m_wSchema
CObject* (PASCAL* m_pfnCreateObject)( );
CRuntimeClass* (PASCAL* m_pfnGetBaseClass)( );
CRuntimeClass* m_pBaseClass;
CObject* CreateObject( );
BOOL IsDerivedFrom(const CRuntimeClass* pBaseClass) const;
};
Header file: | Afx.h |
Platforms: | |
Versions: | 1.0 and later |
Complete documentation: | Visual C++ documentation |
Run-Time Object Model Support, CObject::GetRuntimeClass, CObject::IsKindOf