AnnGetObjectFromTag example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

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

//This example retrieves the annotation handle for any tag 'lTag'
void CTutorDlg::OnAnngetobjectfromtag(long lTag) 
{
   long hTagObject;
   long lTagTest;
   CString strMsg;
   
   m_pRasterAnn->AnnGetObjectFromTag(m_pRasterAnn->GetAnnContainer(), lTag, FALSE);
   hTagObject  = m_pRasterAnn->GetAnnTagObject();

   m_pRasterAnn->AnnGetTag(hTagObject);
   lTagTest = m_pRasterAnn->GetAnnTag();
   if (lTagTest == lTag) 
      strMsg.Format(TEXT("Annotation found with tag %x"), hTagObject);
   else
      strMsg.Format(TEXT("Annotation NOT found with tag %x"), hTagObject);
   AfxMessageBox(strMsg);
}