GetElementLevel Example for C++ 6.0 and later
long x;
long lLevel;
IDicomDSElementPtr pCurrentElement=NULL;
ILEADDicomTagPtr pCurrentTag=NULL;
//Navigate the Data Set as a List, not as a Tree
//Move to the 20th element, and then find that element's level in the Tree
m_pLEADDicomDS->EnableMethodErrors = FALSE;
//move to first element in Data Set
m_pLEADDicomDS->MoveFirstElement(FALSE);
//move to the 20th element
for(x=2; x<20; x++)
m_pLEADDicomDS->MoveNextElement(FALSE);
pCurrentElement = m_pLEADDicomDS->GetCurrentElement();
m_pLEADDicomDS->FindTag(pCurrentElement->GetTag());
lLevel = m_pLEADDicomDS->GetElementLevel();
pCurrentTag = m_pLEADDicomDS->GetCurrentTag();
CString szLevel;
szLevel.Format("%ld", lLevel);
AfxMessageBox("Element: " + pCurrentTag->GetName() + " at level " + szLevel);