AnnGetGrouping example for C++ 5.0 and later

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example toggles the 'group' state of all objects in the main container.
void CTutorDlg::OnButtonAnngetgrouping() 
{
   VARIANT_BOOL bGroup;
   
   //Get current group state
   bGroup = m_pRasterAnn->AnnGetGrouping (m_pRasterAnn->GetAnnContainer());
   
   //Toggle the group state
   m_pRasterAnn->AnnSetGrouping(m_pRasterAnn->GetAnnContainer(), !bGroup, 0);
   
   //Display the group state
   if (m_pRasterAnn->AnnGetGrouping(m_pRasterAnn->GetAnnContainer()))
      AfxMessageBox(TEXT("Objects in AnnContainer are grouped"));
   else
      AfxMessageBox(TEXT("Objects in AnnContainer are not grouped"));      
}