GetShortValue Example for C++ 6.0 and later
void CDicomDlg::TestProc3()
{
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 Short Values
nRet = m_pLEADDicomDS->InsertElement (FALSE, TAG_RECORD_IN_USE_FLAG, VR_US, FALSE, 0);
m_List1.ShowWindow(SW_SHOW);
m_List1.ResetContent();
//insert some short values into the element
m_pLEADDicomDS->ShortValueCount = 5;
for(x=0; x<5; x++)
{
m_pLEADDicomDS->ShortValues[x] = x*100;
}
//set the shorts
nRet = m_pLEADDicomDS->SetShortValue(5);
if(nRet != 0)
{
AfxMessageBox("Error");
return;
}
m_pLEADDicomDS->ShortValueCount = 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->GetShortValue (0, lCount);
if(nRet == 0)
{
for(x=0; x<m_pLEADDicomDS->GetShortValueCount(); x++)
{
//display each value separated by a '.'
szOut.Format("%ld", m_pLEADDicomDS->GetShortValues(x));
m_List1.AddString(szOut);
}
}
AfxMessageBox("wait");
}