// LoadDlg.cpp : implementation file // #include "stdafx.h" #include "resource.h" #include "NewDlg.h" ///////////////////////////////////////////////////////////////////////////// // CDicomNewDlg dialog CDicomNewDlg::CDicomNewDlg(CWnd* pParent /*=NULL*/) : CDialog(CDicomNewDlg::IDD, pParent) { //{{AFX_DATA_INIT(CDicomNewDlg) //}}AFX_DATA_INIT m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CDicomNewDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDicomNewDlg) DDX_Control(pDX, IDC_CLASS, m_Class); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDicomNewDlg, CDialog) //{{AFX_MSG_MAP(CDicomNewDlg) ON_LBN_DBLCLK(IDC_CLASS, OnDblclkClass) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDicomNewDlg message handlers BOOL CDicomNewDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon pDICOMIOD pIOD; int nIndex; RemoveClasses(); pIOD = LDicomIOD::GetFirst(NULL, TRUE); while (pIOD != NULL) { nIndex = m_Class.AddString(pIOD->pszName); m_Class.SetItemData(nIndex, (DWORD)pIOD->nCode); pIOD = LDicomIOD::GetNext(pIOD, TRUE); } m_Class.SetCurSel(2); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDicomNewDlg::RemoveClasses() { pDICOMIOD pClass =NULL; long x; for(x=0;xFindFirstElement(NULL, TAG_SOP_CLASS_UID, FALSE); if(pElement) { L_CHAR *pszText = NULL; L_UINT32 nLength; L_INT nClass = -1 ; nLength = pDS->GetConvertValue(pElement, NULL); if(nLength) { pszText = (L_CHAR *)malloc(nLength); if(pszText) { pDS->GetConvertValue(pElement, pszText); nClass = GetClassFromUID(pszText); if(nClass != -1) { if(pszText) { free(pszText); } return GetIODFromMyList(nClass); } } } if(pszText) { free(pszText); } pDS->FreeValue(pElement); } } return NULL; } void CDicomNewDlg::OnDblclkClass() { OnOK(); }