// DLG_ZFUser.cpp : implementation file // #include "stdafx.h" #include "corpsms.h" #include "DLG_ZFUser.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_ZFUser dialog DLG_ZFUser::DLG_ZFUser(CWnd* pParent /*=NULL*/) : CDialog(DLG_ZFUser::IDD, pParent) { //{{AFX_DATA_INIT(DLG_ZFUser) m_strMobile = _T(""); m_strName = _T(""); //}}AFX_DATA_INIT memset( &m_Data,0,sizeof(m_Data) ); } void DLG_ZFUser::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_ZFUser) DDX_Text(pDX, IDC_ZFUSER_MOBILE, m_strMobile); DDV_MaxChars(pDX, m_strMobile, 15); DDX_Text(pDX, IDC_ZFUSER_NAME, m_strName); DDV_MaxChars(pDX, m_strName, 15); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_ZFUser, CDialog) //{{AFX_MSG_MAP(DLG_ZFUser) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_ZFUser message handlers BOOL DLG_ZFUser::OnInitDialog() { CDialog::OnInitDialog(); m_strName = m_Data.szName; m_strMobile = m_Data.szMobile; UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_ZFUser::SetParam(ANS_MsgSetupData data) { m_Data = data; } ANS_MsgSetupData DLG_ZFUser::GetParam() { return m_Data; } void DLG_ZFUser::OnOK() { UpdateData(true); if ( !isMobileNum( (TCHAR*)(LPCTSTR)m_strMobile ) ) { MessageBox( _T("手机号码输入有误,请确认!") , _T("错误") , MB_ICONWARNING ); GetDlgItem( IDC_ZFUSER_MOBILE )->SetFocus(); return ; } _tcscpy( m_Data.szName , m_strName ); _tcscpy( m_Data.szMobile,m_strMobile); CDialog::OnOK(); }