GetFloatValue Example for C++ 6.0 and later
void CDicomDlg::TestProc5()
{
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 Float Values
nRet = m_pLEADDicomDS->InsertElement(FALSE, TAG_TABLE_OF_PARAMETER_VALUES, VR_FL, FALSE, 0);
m_List1.ShowWindow(SW_SHOW);
m_List1.ResetContent();
//insert some float values into the element
m_pLEADDicomDS->FloatValueCount = 5;
for(x=0; x<5; x++)
{
m_pLEADDicomDS->FloatValues[x] = x*1.99f;
}
//set the floats
nRet = m_pLEADDicomDS->SetFloatValue(5);
if(nRet != 0)
{
AfxMessageBox("Error");
return;
}
m_pLEADDicomDS->FloatValueCount = 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->GetFloatValue (0, lCount);
if(nRet == 0)
{
for(x=0; x<m_pLEADDicomDS->GetFloatValueCount(); x++)
{
//display each value separated by a '.'
szOut.Format("%f", m_pLEADDicomDS->GetFloatValues(x));
m_List1.AddString(szOut);
}
}
AfxMessageBox("wait");
}