MSDN说
AfxDoForAllClasses: Performs a specified function on all CObject-derived classes that 
support run-time type checking. 按照这个解释,所有从CObject类继承而来的类,都会被这个函数检查到并打印出来,会有很多内容。可是我按照上面的实例代码:void DoForAllClasses(const CRuntimeClass* pClass, void* pContext)
{
   ASSERT(pContext != NULL);
   CString *pStr = (CString *)pContext;   *pStr += pClass->m_lpszClassName;
   *pStr += _T("\n");
}
    CString cStr;
    AfxDoForAllClasses(DoForAllClasses, &cStr);
    TRACE(cStr);输出的却很少:
CDockState
CMapWordToOb
CMapStringToString
CMapStringToOb
CStringList
CObList
CWordArray
CStringArray
CObArray
CDWordArray
CByteArray我用的是vc6. 谢谢!

解决方案 »

  1.   

    怪哉,我和楼主找的不一样?
    Calls the specified iteration function for all serializable CObject-derived classes in the application's memory space. Serializable CObject-derived classes are classes derived using the DECLARE_SERIAL macro. The pointer that is passed to AfxDoForAllClasses in pContext is passed to the specified iteration function each time it is called.
    这里明明说,所有"序列化"的并从CObject派生的!
      

  2.   

    你用的是MSDN上的例子代码吧,我这边测试比你上面多两个
    CRichEditCntrItem和CDocItem