GetConvertValue Example for C++ 6.0 and later
short nRet;
long lCount;
long x;
CString strVal;
//add some values to the element
//note, this will only work for elements that have a VR that support multiple values
m_pLEADDicomDS->EnableMethodErrors = FALSE;
m_pLEADDicomDS->StringValueCount = 3;
BSTR bstr;
strVal.Format("%f", 3.45);
bstr = strVal.AllocSysString();
m_pLEADDicomDS->StringValues[0] = bstr;
SysFreeString(bstr);
strVal.Format("%f", 9.99);
bstr = strVal.AllocSysString();
m_pLEADDicomDS->StringValues [1] = bstr;
SysFreeString(bstr);
strVal.Format("%f", 1.11);
bstr = strVal.AllocSysString();
m_pLEADDicomDS->StringValues [2] = bstr;
SysFreeString(bstr);
nRet = m_pLEADDicomDS->SetConvertValue();
//free the current values
m_pLEADDicomDS->StringValueCount = 0;
//now get the values and display them
nRet = m_pLEADDicomDS->GetConvertValue ();
if(nRet == 0)
{
lCount = m_pLEADDicomDS->GetStringValueCount();
m_List1.ResetContent();
for(x=0; x<lCount; x++)
{
//display each value on a separate line
m_List1.AddString(m_pLEADDicomDS->GetStringValues (x));
}
}