⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addteldlg.cpp

📁 tc35i(GSM模块)的控制程序VC源码
💻 CPP
字号:
// AddTelDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GSM_Ctrl_Prj.h"
#include "AddTelDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAddTelDlg dialog


CAddTelDlg::CAddTelDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAddTelDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAddTelDlg)
	m_telStr = _T("");
	m_nameStr = _T("");
	//}}AFX_DATA_INIT
}


void CAddTelDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAddTelDlg)
	DDX_Text(pDX, IDC_TELEDIT, m_telStr);
	DDX_Text(pDX, IDC_NAMEEDIT, m_nameStr);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAddTelDlg, CDialog)
	//{{AFX_MSG_MAP(CAddTelDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAddTelDlg message handlers

void CAddTelDlg::OnOK() 
{
	// TODO: Add extra validation here
		UpdateData(true);

	if(m_telStr.GetLength() == 0)
	{
		MessageBox("手机号不能为空!" , "警告" , MB_OK+MB_ICONWARNING);
		//m_telStr.SetFocus();
		return;
	}
	if(m_telStr.GetLength() != 11)
	{
		MessageBox("手机号位数不对!" , "警告" , MB_OK+MB_ICONWARNING);
		//m_telStr.SetFocus();
		return;
	}
	if(m_nameStr.GetLength() == 0)
		m_nameStr = " ";

	
	CDialog::OnOK();
}

BOOL CAddTelDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	UpdateData(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -