AnnGetVisible 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 visible state of the annotation container.
void CTutorDlg::OnButtonAnngetvisible() 
{
   VARIANT_BOOL bVisible;
   CString strMsg;
   
   m_pRasterAnn->AnnGetVisible(m_pRasterAnn->GetAnnContainer());
   bVisible = m_pRasterAnn->GetAnnVisible();
   m_pRasterAnn->AnnSetVisible(m_pRasterAnn->GetAnnContainer(), !bVisible, ANN_FLAG_RECURSE, "");
   m_pRasterAnn->AnnGetVisible(m_pRasterAnn->GetAnnContainer());
   bVisible = m_pRasterAnn->GetAnnVisible();

   strMsg.Format(TEXT("AnnGetVisible: %s"),bVisible == VARIANT_TRUE ? TEXT("True") : TEXT("False"));
   AfxMessageBox(strMsg);
}