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

📄 comdlg.cpp

📁 一个C语言的串口通信程序
💻 CPP
字号:
// ComDlg.cpp : implementation file
//

#include "stdafx.h"
#include "serealcom.h"
#include "ComDlg.h"


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

/////////////////////////////////////////////////////////////////////////////
// CComDlg dialog


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


void CComDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CComDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CComDlg, CDialog)
	//{{AFX_MSG_MAP(CComDlg)

	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)

	ON_CBN_SELENDOK(IDC_COMBO1, OnSelendokCombo1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CComDlg message handlers

BOOL CComDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    CComboBox *ComBox=(CComboBox*)GetDlgItem(IDC_COMBO1);
	ComBox->AddString("COM1");
    ComBox->AddString("COM2");
	ComBox->AddString("COM3");
	ComBox->AddString("COM4");	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}



void CComDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	SendMessage(WM_CLOSE);
}



void CComDlg::OnSelendokCombo1() 
{
	// TODO: Add your control notification handler code here
	CComboBox *ComBox=(CComboBox*)GetDlgItem(IDC_COMBO1);
	ComNum=ComBox->GetCurSel()+1;			
}

⌨️ 快捷键说明

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