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

📄 comsetdlg.cpp

📁 一个很好的串口程序,利用modbus协议来写的,对很多人可能会有帮助.
💻 CPP
字号:
// ComSetDlg.cpp : implementation file
//

#include "stdafx.h"
#include "examview.h"
#include "ComSetDlg.h"
#include "ComSetSheet.h"

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

/////////////////////////////////////////////////////////////////////////////
// CComSetDlg property page

IMPLEMENT_DYNCREATE(CComSetDlg, CPropertyPage)

CComSetDlg::CComSetDlg() : CPropertyPage(CComSetDlg::IDD)
{
	//{{AFX_DATA_INIT(CComSetDlg)
	m_sBaud = _T("");
	m_sPort = _T("");
	m_sDevID = 2;
	//}}AFX_DATA_INIT
}

CComSetDlg::~CComSetDlg()
{
}

void CComSetDlg::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CComSetDlg)
	DDX_Control(pDX, IDC_INTERVAL, m_bBaud);
	DDX_Control(pDX, IDC_PORT, m_cPort);
	DDX_CBString(pDX, IDC_BAUD, m_sBaud);
	DDX_CBString(pDX, IDC_PORT, m_sPort);
	DDX_Text(pDX, IDC_DEVICE_ID, m_sDevID);
	DDV_MinMaxInt(pDX, m_sDevID, 1, 247);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CComSetDlg, CPropertyPage)
	//{{AFX_MSG_MAP(CComSetDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CComSetDlg message handlers

BOOL CComSetDlg::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here
	
	((CComboBox*)GetDlgItem(IDC_BAUD))->SetCurSel(0);
	((CComboBox*)GetDlgItem(IDC_PORT))->SetCurSel(0);
	((CComboBox*)GetDlgItem(IDC_INTERVAL))->SetCurSel(0);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CComSetDlg::CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	CPropertyPage::CalcWindowRect(lpClientRect, nAdjustType);
}

⌨️ 快捷键说明

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