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

📄 setcomm.cpp

📁 基于WIN CE 的抄表系统,环境wince .net
💻 CPP
字号:
// SetComm.cpp : implementation file
//

#include "stdafx.h"
#include "Cbsystem.h"
#include "SetComm.h"

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


/////////////////////////////////////////////////////////////////////////////
// CSetComm dialog


CSetComm::CSetComm(CWnd* pParent /*=NULL*/)
	: CDialog(CSetComm::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSetComm)
	m_strBand = _T("");
	m_strBitData = _T("");
	m_strParity = _T("");
	m_strPort = _T("");
	m_strStopBit = _T("");
	//}}AFX_DATA_INIT
}


void CSetComm::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSetComm)
	DDX_CBString(pDX, IDC_BAND, m_strBand);
	DDX_CBString(pDX, IDC_BITDATA, m_strBitData);
	DDX_CBString(pDX, IDC_PARITY, m_strParity);
	DDX_CBString(pDX, IDC_PORT, m_strPort);
	DDX_CBString(pDX, IDC_STOPBIT, m_strStopBit);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CSetComm message handlers

BOOL CSetComm::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CString pstr0,pstr1,pstr2,pstr3;
	CWinApp * pApp = AfxGetApp();
	pstr0	= pApp->GetProfileString(TEXT("Lgkj\\com"), TEXT("Port"));
	pstr1	= pApp->GetProfileString(TEXT("Lgkj\\com"), TEXT("Band"));
	pstr2	= pApp->GetProfileString(TEXT("Lgkj\\com"), TEXT("BitData"));
	pstr3	= pApp->GetProfileString(TEXT("Lgkj\\com"), TEXT("StopBit"));
	
	((CComboBox*)GetDlgItem(IDC_PORT))->SelectString(0, pstr0);
	((CComboBox*)GetDlgItem(IDC_BAND))->SelectString(0, pstr1);
	((CComboBox*)GetDlgItem(IDC_BITDATA))->SelectString(0, pstr2);
	((CComboBox*)GetDlgItem(IDC_STOPBIT))->SelectString(0, pstr3);
	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 + -