Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

The typical scenario of iterating around all/relevant nodes is as follows:

//Always get the start position before traversing
POSITION pos = BarEnumGetStartPosition();
for( ; pos != NULL; )
{
    CExtDynamicControlBar * pBar = 
        BarEnumGetNext( 
            pos 
            true, // Specify persistent dynamic bars with true
            true// Specify simple dynamic bars with true
            );
    ASSERT_VALID( pBar );
    // do what you need
}