AfxDoForAllObjects 

void AfxDoForAllObjects( void (*pfn)(CObject* pObject, void* pContext), void* pContext );

Parameters

pfn

Points to an iteration function to execute for each object. The function arguments are a pointer to a CObject and a void pointer to extra data that the caller supplies to the function.

pContext

Points to optional data that the caller can supply to the iteration function. This pointer can be NULL.

Remarks

Executes the specified iteration function for all objects derived from CObject that have been allocated with new. Stack, global, or embedded objects are not enumerated. The pointer passed to AfxDoForAllObjects 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.