L_DicomGetConvertValue
#include "Ltdic.h"
L_UINT32 EXT_FUNCTION L_DicomGetConvertValue(hDS, pElement, pszText)
HDICOMDS hDS; |
/* a DICOM */ |
pDICOMELEMENT pElement; |
/* pointer to a DICOMELEMENT structure */ |
L_CHAR *pszText; |
/* character string */ |
Converts the value of an element to a string and returns the number of characters in that string. Items in the string are separated by a '\'.
Parameter |
Description |
hDS |
A DICOM handle. |
pElement |
Pointer to a DICOMELEMENT structure within the Data Set. |
pszText |
Character string to be updated with the string version of the value. |
Returns
Number of characters in the pszText parameter.
Comments
Call this function twice. The first should have pszText set to NULL. This will provide you with the size of the string that will be stored in pszText. Next, allocate the memory required for pszText and call this function again to update pszText with the string.
Required DLLs and Libraries
LTDIC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
|
Topics: |
Example
/* This example converts the value to a string and display it in a list-box control */
L_VOID Test(HWND hDlg, HDICOMDS hDS, pDICOMELEMENT pElement)
{
L_CHAR *pszText;
L_CHAR *p;
L_CHAR *q;
L_UINT32 nLength;
L_UINT32 nCount;
L_UINT32 i;
nCount = L_DicomGetCountValue(hDS, pElement);
nLength = L_DicomGetConvertValue(hDS, pElement, NULL);
pszText = (L_CHAR *)malloc(nLength);
L_DicomGetConvertValue(hDS, pElement, pszText);
for (i = 0, p = pszText; i < nCount; i++)
{
q = strchr(p, '\\');
if (q != NULL)
{
*q++ = 0;
}
SendMessage(hDlg, LB_ADDSTRING, (WPARAM)0, (LPARAM)(LPCTSTR)p);
p = q;
}
free(pszText);
L_DicomFreeValue(hDS, pElement);
}