GetDoubleValue Example for C++ 6.0 and later
void CDicomDlg::TestProc6()
{
long lCount;
long x;
short nRet;
m_pLEADDicomDS->EnableMethodErrors = FALSE;
//move to the root element
m_pLEADDicomDS->MoveFirstElement(FALSE);
m_pLEADDicomDS->MoveRootElement();
m_List1.ShowWindow(SW_SHOW);
m_List1.ResetContent();
//insert a new element for the Double Values
nRet = m_pLEADDicomDS->InsertElement(FALSE, TAG_REFERENCE_PIXEL_PHYSICAL_VALUE_X, VR_FD, FALSE, 0);
m_List1.ShowWindow(SW_SHOW);
m_List1.ResetContent();
//insert some Double values into the element
m_pLEADDicomDS->DoubleValueCount = 5;
for(x=0; x<5; x++)
{
m_pLEADDicomDS->DoubleValues[x] = 10 * x * 199.77;
}
//set the Doubles
nRet = m_pLEADDicomDS->SetDoubleValue (5);
if(nRet != 0)
{
AfxMessageBox("Error");
return;
}
m_pLEADDicomDS->DoubleValueCount = 0; //free the values
//get the value count
lCount = m_pLEADDicomDS->GetValueCount ();
CString szOut;
szOut.Format("There are %ld values!", lCount);
AfxMessageBox(szOut);
//get the values
nRet = m_pLEADDicomDS->GetDoubleValue(0, lCount);
if(nRet == 0)
{
for(x=0; x<m_pLEADDicomDS->GetDoubleValueCount (); x++)
{
//display each value separated by a '.'
szOut.Format("%f", m_pLEADDicomDS->GetDoubleValues(x));
m_List1.AddString(szOut);
}
}
AfxMessageBox("wait");
}