AnnSetGrouping example for C++ 4.0 and later

// This example will temporarily disable the grouping in all objects
// and re-enable the grouping later

// disable grouping in all groups
m_Lead1.AnnSetGrouping(m_Lead1.GetAnnContainer(), FALSE, ANNFLAG_RECURSE);

… // you can now select and change individual objects from groups
… // you can also put the two calls to AnnSetGrouping in two
… // buttons

// re-enable grouping all groups
// note that we do NOT enable grouping in the topmost container!
// if you enable the grouping in the top container, then all the 
// objects will act as a group!

m_Lead1.AnnSetGrouping(m_Lead1.GetAnnContainer(), TRUE, ANNFLAG_RECURSE|ANNFLAG_NOTTHIS);