connectinfodlg.cpp

来自「一个用串口gprs modem发短信的源程序」· C++ 代码 · 共 62 行

CPP
62
字号
// ConnectInfoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "SmsDemo.h"
#include "ConnectInfoDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CConnectInfoDlg dialog


CConnectInfoDlg::CConnectInfoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CConnectInfoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConnectInfoDlg)
	m_strRate = _T("");
	m_strCommName = _T("");
	//}}AFX_DATA_INIT
}


void CConnectInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConnectInfoDlg)
	DDX_CBString(pDX, IDC_RATE_COMBO, m_strRate);
	DDX_CBString(pDX, IDC_COMM_NAME_COMBO, m_strCommName);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CConnectInfoDlg message handlers

void CConnectInfoDlg::OnOK() 
{
	if(UpdateData(TRUE)==FALSE)
		return;
	if(strlen(m_strCommName)==0)
	{
		MessageBox("请选择设备连接串口名称!");
		return;
	}
	if(strlen(m_strRate)==0)
	{
		MessageBox("请选择设备连接波特率!");
		return;
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

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