// DLG_K_CM_Add.cpp : implementation file // #include "stdafx.h" #include "smsmanager.h" #include "DLG_K_CM_Add.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_K_CM_Add dialog DLG_K_CM_Add::DLG_K_CM_Add(CWnd* pParent /*=NULL*/) : CDialog(DLG_K_CM_Add::IDD, pParent) { //{{AFX_DATA_INIT(DLG_K_CM_Add) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_lMaxChar = 64; } void DLG_K_CM_Add::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_K_CM_Add) DDX_Control(pDX, IDC_K_CM_S1, m_B_S1); DDX_Control(pDX, IDC_K_CM_BZ, m_E_BZ); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_K_CM_Add, CDialog) //{{AFX_MSG_MAP(DLG_K_CM_Add) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_K_CM_Add message handlers BOOL DLG_K_CM_Add::OnInitDialog() { CDialog::OnInitDialog(); m_B_S1.SetWindowText(m_strTitle); m_E_BZ.LimitText(m_lMaxChar); m_E_BZ.SetWindowText(m_strCM); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_K_CM_Add::SetParam(CString strTitle,CString strCM, long lMaxChar) { m_strTitle = strTitle; m_strCM = strCM; m_lMaxChar = lMaxChar; } void DLG_K_CM_Add::OnOK() { m_E_BZ.GetWindowText(m_strBZ); if ( m_strBZ.GetLength()<2 ) { MessageBox( _T("输入有误,内容为空或内容太短!") , _T("错误") , MB_ICONWARNING ); m_E_BZ.SetFocus(); return ; } CDialog::OnOK(); }