// DLG_Setup_SZGJ_Line.cpp : implementation file // #include "stdafx.h" #include "corpsms.h" #include "DLG_Setup_SZGJ_Line.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_Setup_SZGJ_Line dialog DLG_Setup_SZGJ_Line::DLG_Setup_SZGJ_Line(CWnd* pParent /*=NULL*/) : CDialog(DLG_Setup_SZGJ_Line::IDD, pParent) { //{{AFX_DATA_INIT(DLG_Setup_SZGJ_Line) m_strName = _T(""); //}}AFX_DATA_INIT } void DLG_Setup_SZGJ_Line::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_Setup_SZGJ_Line) DDX_Text(pDX, IDC_SYSSETUP_SZGJ_LINENAME, m_strName); DDV_MaxChars(pDX, m_strName, 18); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_Setup_SZGJ_Line, CDialog) //{{AFX_MSG_MAP(DLG_Setup_SZGJ_Line) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_Setup_SZGJ_Line message handlers BOOL DLG_Setup_SZGJ_Line::OnInitDialog() { CDialog::OnInitDialog(); m_strName = m_strLine; UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_Setup_SZGJ_Line::OnOK() { if ( !UpdateData(true) ) return ; if ( m_strName.GetLength()<=0 ) { MessageBox( _T("线路号不能为空,请输入线路号!"),_T("错误"),MB_ICONWARNING ); return ; } m_strLine = m_strName; CDialog::OnOK(); }