Adding a DICOM Data Set to a DICOM Directory 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 load a Data Set and then add it to a
// DICOM Directory
ILEADDicomDirPtr spDicomDir(__uuidof(LEADDicomDir));
// Set the destination folder
spDicomDir->ResetDicomDir("C:\\Medical Images");
// Load a Data Set and add it to the Directory
if (m_LeadDicomCtrl.LoadDS("C:\\Medical Images\\Image", 0) == DICOM_SUCCESS)
{
spDicomDir->InsertDicomDS(m_LeadDicomCtrl.GetHDicomDS(),
"C:\\Medical Images\\Image");
// Save the DICOMDIR File
spDicomDir->SaveDicomDir();
}
spDicomDir = NULL;