从afx.h中摘抄--
目录X:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afx.h
1,类继承关系
/
// Classes declared in this file
// in addition to standard primitive data types and various helper macros
struct CRuntimeClass; // object type information
class CObject; // the root of all objects classes
class CException; // the root of all exceptions
class CArchiveException; // archive exception
class CFileException; // file exception
class CSimpleException;
class CMemoryException; // out-of-memory exception
class CNotSupportedException; // feature not supported exception
class CInvalidArgException; // one of the parameters to the function is invalid
class CFile; // raw binary file
class CStdioFile; // buffered stdio text/binary file
class CMemFile; // memory based file
// Non CObject classes
struct CFileStatus; // file status information
struct CMemoryState; // diagnostic memory support
class CArchive; // object persistence tool
class CDumpContext; // object diagnostic dumping
/
2,CRuntimeClass 结构体
/
// Basic object model
// generate static object constructor for class registration
void AFXAPI AfxClassInit(CRuntimeClass* pNewClass);
struct AFX_CLASSINIT
{ AFX_CLASSINIT(CRuntimeClass* pNewClass) { AfxClassInit(pNewClass); } };
struct CRuntimeClass
{
// Attributes
LPCSTR m_lpszClassName;
int m_nObjectSize;
UINT m_wSchema; // schema number of the loaded class
CObject* (PASCAL* m_pfnCreateObject)(); // NULL => abstract class
#ifdef _AFXDLL
CRuntimeClass* (PASCAL* m_pfnGetBaseClass)();
#else
CRuntimeClass* m_pBaseClass;
#endif
// Operations
CObject* CreateObject();
BOOL IsDerivedFrom(const CRuntimeClass* pBaseClass) const;
// dynamic name lookup and creation
static CRuntimeClass* PASCAL FromName(LPCSTR lpszClassName);
static CRuntimeClass* PASCAL FromName(LPCWSTR lpszClassName);
static CObject* PASCAL CreateObject(LPCSTR lpszClassName);
static CObject* PASCAL CreateObject(LPCWSTR lpszClassName);
// Implementation
void Store(CArchive& ar) const;
static CRuntimeClass* PASCAL Load(CArchive& ar, UINT* pwSchemaNum);
// CRuntimeClass objects linked together in simple list
CRuntimeClass* m_pNextClass; // linked list of registered classes
const AFX_CLASSINIT* m_pClassInit;
};
/
3&#x