Manipulating a Data Set Using the LEADTOOLS DICOM OCX Control Example for C++ 6.0 and later
// Use #import to incorporate the type library information.
// For example:
// #import "C:\Windows\System32\LTDicKrn14n.dll" no_namespace
// #import "C:\Windows\System32\LTDicDir14n.dll" no_namespace
// The following code snippet demonstrates how to use the LEADTOOLS DICOM
// OCX control (m_LeadDicomCtrl) to get the Value of the Implementation Class
// UID element of a DICOM Directory
ILEADDicomDirPtr spDicomDir(__uuidof(LEADDicomDir));
short nRetValue;
// Load a DICOMDIR File
nRetValue = spDicomDir->LoadDicomDir("C:\\Medical Images\\DICOMDIR",
DS_LOAD_CLOSE);
if (nRetValue == DICOM_SUCCESS)
{
m_LeadDicomCtrl.SetHDicomDS(spDicomDir->hDicomDirDS);
nRetValue = m_LeadDicomCtrl.FindFirstElement(TAG_IMPLEMENTATION_CLASS_UID,
FALSE);
if (nRetValue == DICOM_SUCCESS)
{
m_LeadDicomCtrl.GetConvertValue();
// Display the value of the element
AfxMessageBox(m_LeadDicomCtrl.GetStringValues(0));
m_LeadDicomCtrl.SetStringValueCount(0);
}
}
spDicomDir = NULL;