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

📄 setup.cpp

📁 WinCE环境下串口接收、发送数据的一个程序
💻 CPP
字号:
// Setup.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "Setup.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSetup dialog


CSetup::CSetup(CWnd* pParent /*=NULL*/)
	: CDialog(CSetup::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSetup)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CSetup::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSetup)
	DDX_Control(pDX, IDC_COMBO_STOPBITS, m_StopBits);
	DDX_Control(pDX, IDC_COMBO_PORTNO, m_PortNo);
	DDX_Control(pDX, IDC_COMBO_PARITY, m_Parity);
	DDX_Control(pDX, IDC_COMBO_DATABITS, m_DataBits);
	DDX_Control(pDX, IDC_COMBO_BAUDRATE, m_BaudRate);
	// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSetup, CDialog)
	//{{AFX_MSG_MAP(CSetup)
	ON_CBN_SELCHANGE(IDC_COMBO_PORTNO, OnSelchangeComboPortno)
	ON_CBN_SELCHANGE(IDC_COMBO_BAUDRATE, OnSelchangeComboBaudrate)
	ON_CBN_SELCHANGE(IDC_COMBO_DATABITS, OnSelchangeComboDatabits)
	ON_CBN_SELCHANGE(IDC_COMBO_STOPBITS, OnSelchangeComboStopbits)
	ON_CBN_SELCHANGE(IDC_COMBO_PARITY, OnSelchangeComboParity)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSetup message handlers

void CSetup::OnSelchangeComboPortno() 
{
	// TODO: Add your control notification handler code here
	if(m_PortNo.GetCurSel()!=CB_ERR)
	{
		PortNo=m_PortNo.GetCurSel();
	}
}

void CSetup::OnSelchangeComboBaudrate() 
{
	// TODO: Add your control notification handler code here
	if(m_BaudRate.GetCurSel()!=CB_ERR)
	{
		BaudRate=m_BaudRate.GetCurSel();
	}
}

void CSetup::OnSelchangeComboDatabits() 
{
	// TODO: Add your control notification handler code here
	if(m_DataBits.GetCurSel()!=CB_ERR)
	{
		DataBits=m_DataBits.GetCurSel();
	}
}

void CSetup::OnSelchangeComboStopbits() 
{
	// TODO: Add your control notification handler code here
	if(m_StopBits.GetCurSel()!=CB_ERR)
	{
		StopBits=m_StopBits.GetCurSel();
	}
}

void CSetup::OnSelchangeComboParity() 
{
	// TODO: Add your control notification handler code here
	if(m_Parity.GetCurSel()!=CB_ERR)
	{
		Parity=m_Parity.GetCurSel();
	}
}


BOOL CSetup::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_StopBits.SetCurSel(StopBits);
	m_PortNo.SetCurSel(PortNo);
	m_Parity.SetCurSel(Parity);//
	m_BaudRate.SetCurSel(BaudRate);
	m_DataBits.SetCurSel(DataBits);

	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 + -