Visual Studio 2010 - Visual C++
AfxDoForAllClasses
Calls the specified iteration function for all serializable CObject-derived classes in the application's memory space.
void AFXAPI AfxDoForAllClasses( void (*pfn )(const CRuntimeClass* pClass, void* pContext ), void* pContext );
Parameters
Remarks
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.
Note
|
|---|
|
This function works only in the Debug version of MFC. |
Example
Visual C++
#ifdef _DEBUG void DoForAllClasses(const CRuntimeClass* pClass, void* pContext) { ASSERT(pContext != NULL); CString *pStr = (CString *)pContext; *pStr += pClass->m_lpszClassName; *pStr += _T("\n"); } #endif
Visual C++
#ifdef _DEBUG CString cStr; AfxDoForAllClasses(DoForAllClasses, &cStr); AfxMessageBox(cStr); #endif
Requirements
Header: afx.h
See Also
Note