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

📄 ppagesetcharge.cpp

📁 一个串口通信好例子,是完整的VC++工程,很值得初学者学习.
💻 CPP
字号:
// PPageSetCharge.cpp : implementation file
//

#include "stdafx.h"
#include "parksys.h"
#include "PPageSetCharge.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPPageSetCharge property page

IMPLEMENT_DYNCREATE(CPPageSetCharge, CPropertyPage)

CPPageSetCharge::CPPageSetCharge() : CPropertyPage(CPPageSetCharge::IDD)
{
	//{{AFX_DATA_INIT(CPPageSetCharge)
	//}}AFX_DATA_INIT
}

CPPageSetCharge::~CPPageSetCharge()
{
}

void CPPageSetCharge::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPPageSetCharge)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPPageSetCharge, CPropertyPage)
	//{{AFX_MSG_MAP(CPPageSetCharge)
	ON_CBN_EDITCHANGE(IDC_CHARGETYPE, OnSelchangeChargetype)
	ON_CBN_EDITCHANGE(IDC_CARDCLASS, OnSelchangeCardclass)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CPPageSetCharge::SetCombCurSel(UINT nIDComb, UINT index)
{
	CWnd* pWnd = GetDlgItem(nIDComb);
	CComboBox* p_comb;
	p_comb = (CComboBox*)pWnd;
	p_comb->SetCurSel(index);
}

UINT CPPageSetCharge::GetCombCurSel(UINT nIDComb)
{
	CWnd* pWnd = GetDlgItem(nIDComb);
	CComboBox* p_comb;
	p_comb = (CComboBox*)pWnd;
	return p_comb->GetCurSel();
}

/////////////////////////////////////////////////////////////////////////////
// CPPageSetCharge message handlers

BOOL CPPageSetCharge::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetCombCurSel(IDC_CHARGETYPE, m_chargetype);
	SetCombCurSel(IDC_CARDCLASS, m_cardclass);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CPPageSetCharge::OnSelchangeChargetype() 
{
	// TODO: Add your control notification handler code here
	m_chargetype = GetCombCurSel(IDC_CHARGETYPE);
}

void CPPageSetCharge::OnSelchangeCardclass() 
{
	// TODO: Add your control notification handler code here
	m_cardclass = GetCombCurSel(IDC_CARDCLASS);
}

⌨️ 快捷键说明

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