📄 myconnect.cpp
字号:
// MyConnect.cpp : implementation file
//
#include "stdafx.h"
#include "CDMASMSS.h"
#include "MyConnect.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyConnect dialog
CMyConnect::CMyConnect(CWnd* pParent /*=NULL*/)
: CDialog(CMyConnect::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyConnect)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMyConnect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyConnect)
DDX_Control(pDX, IDC_COMBO2, m_bit);
DDX_Control(pDX, IDC_COMBO1, m_port);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyConnect, CDialog)
//{{AFX_MSG_MAP(CMyConnect)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
ON_CBN_SELCHANGE(IDC_COMBO2, OnSelchangeCombo2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyConnect message handlers
BOOL CMyConnect::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_bit.InsertString(0,"4800");
m_bit.InsertString(1,"9600");
m_bit.InsertString(2,"19200");
m_bit.InsertString(3,"28800");
m_bit.InsertString(4,"38400");
m_bit.InsertString(5,"57600");
m_bit.InsertString(6,"115200");
m_port.SetCurSel(0);
m_bit.SetCurSel(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMyConnect::OnSelchangeCombo1()
{
// TODO: Add your control notification handler code here
int m;
UINT ComTable[4] = {1,2,3,4};
m = m_port.GetCurSel();
m_port.SetCurSel(m);
theApp.m_port = ComTable[m];
}
void CMyConnect::OnSelchangeCombo2()
{
// TODO: Add your control notification handler code here
int m;
UINT ComTable[7] = {4800,9600,19200,28800,38400,57600,115200};
m = m_bit.GetCurSel();
m_bit.SetCurSel(m);
theApp.m_bit = ComTable[m];
}
void CMyConnect::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -