FindFirstElement 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 first image element and display it
m_pLEADDicomDS->EnableMethodErrors = FALSE;
//move to first element in Data Set
m_pLEADDicomDS->MoveFirstElement(FALSE);
nRet = m_pLEADDicomDS->FindFirstElement(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->FindNextElement(FALSE);
}
AfxMessageBox("No More Images");