MoveFirstTag Example for C++ 6.0 and later

   m_pLEADDicomDS->MoveFirstTag ();
   DisplayItem();
   AfxMessageBox("wait");

   m_pLEADDicomDS->MoveNextTag ();
   DisplayItem();
   AfxMessageBox("wait");

   m_pLEADDicomDS->MoveLastTag ();
   DisplayItem();
   AfxMessageBox("wait");

   m_pLEADDicomDS->MovePrevTag ();
   DisplayItem();
   AfxMessageBox("wait");




void CDicomDlg::DisplayItem()
{
   CString szOut;
   ILEADDicomTagPtr pCurrentTag=NULL;

   pCurrentTag = m_pLEADDicomDS->GetCurrentTag ();

   szOut.Format("%04X:%04X", GETGROUP(pCurrentTag->GetCode()), GETELEMENT(pCurrentTag->GetCode()));
   m_Text1.SetWindowText(szOut);

   szOut.Format("%04X:%04X", GETGROUP(pCurrentTag->GetMask()), GETELEMENT(pCurrentTag->GetMask()));
   m_Text2.SetWindowText(szOut);

   m_Text3.SetWindowText(pCurrentTag->GetName());

   //display the items information
   switch(pCurrentTag->GetVR())
   {
   case VR_AE:
      m_Text4.SetWindowText("AE");
      break;
   case VR_AS:
      m_Text4.SetWindowText("AS");
      break;
   case VR_AT:
      m_Text4.SetWindowText("AT");
      break;
   case VR_CS:
      m_Text4.SetWindowText("CS");
      break;
   case VR_DA:
      m_Text4.SetWindowText("DA");
      break;
   case VR_DS:
      m_Text4.SetWindowText("DS");
      break;
   case VR_DT:
      m_Text4.SetWindowText("DT");
      break;
   case VR_FD:
      m_Text4.SetWindowText("FD");
      break;
   case VR_FL:
      m_Text4.SetWindowText("FL");
      break;
   case VR_IS:
      m_Text4.SetWindowText("IS");
      break;
   case VR_LO:
      m_Text4.SetWindowText("LO");
      break;
   case VR_LT:
      m_Text4.SetWindowText("LT");
      break;
   case VR_OB:
      m_Text4.SetWindowText("OB");
      break;
   case VR_OW:
      m_Text4.SetWindowText("OW");
      break;
   case VR_PN:
      m_Text4.SetWindowText("PN");
      break;
   case VR_SH:
      m_Text4.SetWindowText("SH");
      break;
   case VR_SL:
      m_Text4.SetWindowText("SL");
      break;
   case VR_SQ:
      m_Text4.SetWindowText("SQ");
      break;
   case VR_SS:
      m_Text4.SetWindowText("SS");
      break;
   case VR_ST:
      m_Text4.SetWindowText("ST");
      break;
   case VR_TM:
      m_Text4.SetWindowText("TM");
      break;
   case VR_UI:
      m_Text4.SetWindowText("UI");
      break;
   case VR_UL:
      m_Text4.SetWindowText("UL");
      break;
   case VR_UN:
      m_Text4.SetWindowText("UN");
      break;
   case VR_US:
      m_Text4.SetWindowText("US");
      break;
   case VR_UT:
      m_Text4.SetWindowText("UT");
      break;
   default:
      szOut.Format("%d", pCurrentTag->GetVR());
      m_Text4.SetWindowText(szOut);
      break;
   }

   szOut.Format("%d", pCurrentTag->GetMinVM());
   m_Text5.SetWindowText(szOut);
   szOut.Format("%d", pCurrentTag->GetMaxVM());
   m_Text6.SetWindowText(szOut);
   szOut.Format("%d", pCurrentTag->GetDivideVM());
   m_Text7.SetWindowText(szOut);
}