// Session.cpp : implementation file // #include "stdafx.h" #include "netapp.h" #include "Session.h" ///////////////////////////////////////////////////////////////////////////// // CNetSessionDlg dialog CNetSessionDlg::CNetSessionDlg(CWnd* pParent /*=NULL*/) : CDialog(CNetSessionDlg::IDD, pParent) { //{{AFX_DATA_INIT(CNetSessionDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CNetSessionDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CNetSessionDlg) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CNetSessionDlg, CDialog) //{{AFX_MSG_MAP(CNetSessionDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CNetSessionDlg message handlers BOOL CNetSessionDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon SetDlgItemText(IDC_NICKNAME, m_pSession->m_strNickname); SetDlgItemText(IDC_SERVER_TITLE, m_pSession->m_strServerTitle); SetDlgItemText(IDC_SERVER_ADDRESS, m_pSession->m_strServerAddress); SetDlgItemInt (IDC_SERVER_PORT, m_pSession->m_nServerPort, FALSE); SetDlgItemText(IDC_CLIENT_TITLE, m_pSession->m_strClientTitle); SetDlgItemInt (IDC_CLIENT_PORT, m_pSession->m_nClientPort, FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CNetSessionDlg::OnOK() { CString szMode; GetDlgItemText(IDC_NICKNAME, m_pSession->m_strNickname); GetDlgItemText(IDC_SERVER_TITLE, m_pSession->m_strServerTitle); GetDlgItemText(IDC_SERVER_ADDRESS, m_pSession->m_strServerAddress); m_pSession->m_nServerPort = GetDlgItemInt(IDC_SERVER_PORT, NULL, FALSE); GetDlgItemText(IDC_CLIENT_TITLE, m_pSession->m_strClientTitle); m_pSession->m_nClientPort = GetDlgItemInt(IDC_CLIENT_PORT, NULL, FALSE); CDialog::OnOK(); }