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

📄 comselectdlg.cpp

📁 下面是串口通信开发的部分原码,自己写的,可能有些错误,希望大大家指教.
💻 CPP
字号:
#include "StdAfx.h"
#include "SerialTestMFC.h"
#include "ComSelectDlg.h"

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


/////////////////////////////////////////////////////////////////////////////
// CComSelectDlg

BEGIN_MESSAGE_MAP(CComSelectDlg, CDialog)
	//{{AFX_MSG_MAP(CComSelectDlg)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CComSelectDlg methods

CComSelectDlg::CComSelectDlg(CWnd* pParent /*=0*/)
	: CDialog(CComSelectDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CComSelectDlg)
	m_nComIndex = 0;
	//}}AFX_DATA_INIT
}


void CComSelectDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CComSelectDlg)
	DDX_Radio(pDX, IDC_COM1, m_nComIndex);
	//}}AFX_DATA_MAP
}

void CComSelectDlg::OnOK (void)
{
	// Make sure the data is valid
	UpdateData(TRUE);

	// Generate the COM port string
	m_strComPort.Format(_T("COM%d"), m_nComIndex+1);

	// Call base class
	CDialog::OnOK();
}

⌨️ 快捷键说明

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