// NetKeyEdit.cpp : implementation file // #include "stdafx.h" #include "netapp.h" #include "NetKeyEdit.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CNetKeyEdit dialog CNetKeyEdit::CNetKeyEdit(CWnd* pParent /*=NULL*/) : CDialog(CNetKeyEdit::IDD, pParent) { //{{AFX_DATA_INIT(CNetKeyEdit) //}}AFX_DATA_INIT m_szKey = ""; } void CNetKeyEdit::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CNetKeyEdit) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CNetKeyEdit, CDialog) //{{AFX_MSG_MAP(CNetKeyEdit) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CNetKeyEdit message handlers void CNetKeyEdit::OnOK() { CString szKey; UpdateData(true); GetDlgItemText(IDC_EDIT_KEY, szKey); if (_atoi64(szKey) != 0) { m_szKey = szKey; CDialog::OnOK(); } else { SetDlgItemText(IDC_EDIT_KEY,""); } } BOOL CNetKeyEdit::OnInitDialog() { CDialog::OnInitDialog(); SetDlgItemText(IDC_EDIT_KEY, m_szKey); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }