FindLastElement Example for C++ 6.0 and later
IDicomDSElementPtr pCurrentElement=NULL;
ILEADDicomTagPtr pCurrentTag=NULL;
short nRet;
m_LEADRasterView1.ShowWindow(SW_SHOW);
m_List1.ShowWindow(SW_HIDE);
//Find the last image element and display it
m_pLEADDicomDS->EnableMethodErrors = FALSE;
//move to last element in Data Set
m_pLEADDicomDS->MoveLastElement(FALSE);
nRet = m_pLEADDicomDS->FindLastElement(TAG_PIXEL_DATA, FALSE);
pCurrentElement = m_pLEADDicomDS->GetCurrentElement();
//find each image
while(nRet == 0)
{
m_pLEADDicomDS->GetBitmapValue(0, 0, ORDER_RGB, 0);
m_LEADRasterView1.GetRaster().SetBitmap(m_pLEADDicomDS->GetBitmap());
m_pLEADDicomDS->Bitmap = 0;
m_pLEADDicomDS->FindTag(pCurrentElement->GetTag());
pCurrentTag = m_pLEADDicomDS->GetCurrentTag();
AfxMessageBox("Element: " + pCurrentTag->GetName());
nRet = m_pLEADDicomDS->FindPrevElement(FALSE);
}
AfxMessageBox("No More Images");