// InfoDlg.cpp : implementation file // #include "stdafx.h" #include "dicomapp.h" #include "InfoDlg.h" ///////////////////////////////////////////////////////////////////////////// // CDicomInfoDlg dialog CDicomInfoDlg::CDicomInfoDlg(CWnd* pParent /*=NULL*/) : CDialog(CDicomInfoDlg::IDD, pParent) { //{{AFX_DATA_INIT(CDicomInfoDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CDicomInfoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDicomInfoDlg) DDX_Control(pDX, IDC_PREAMBLE, m_Preamble); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDicomInfoDlg, CDialog) //{{AFX_MSG_MAP(CDicomInfoDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDicomInfoDlg message handlers BOOL CDicomInfoDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon L_CHAR Preamble[DS_PREAMBLE_LENGTH]; L_INT i, j; CString strText; CString strTemp; L_UINT32 nClass; L_UINT16 nFlags; pDICOMIOD pIOD; m_pDS->GetInfoDS(&nClass, &nFlags); pIOD = LDicomIOD::FindClass(nClass); if (pIOD == NULL) { strText.Format("Unknown (%ld)", nClass); } else { strText = pIOD->pszName; } SetDlgItemText(IDC_CLASS, strText); if (nFlags & DS_METAHEADER_PRESENT) { SetDlgItemText(IDC_METAHEADER, "Present"); m_pDS->GetPreamble(Preamble, DS_PREAMBLE_LENGTH); for (i = 0; i < DS_PREAMBLE_LENGTH / 8; i++) { strText = ""; for (j = 0; j < 8; j++) { strTemp.Format("%02X\t", (L_UCHAR)Preamble[i*16+j]); strText += strTemp; } m_Preamble.AddString(strText); } } else { SetDlgItemText(IDC_METAHEADER, "Absent"); } if (nFlags & DS_LITTLE_ENDIAN) { SetDlgItemText(IDC_TS, "Little-Endian"); } else { SetDlgItemText(IDC_TS, "Big-Endian"); } if (nFlags & DS_EXPLICIT_VR) { SetDlgItemText(IDC_VR, "Explicit"); } else { SetDlgItemText(IDC_VR, "Implicit"); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }