📄 msgdealdlg.cpp
字号:
// MsgDealDlg.cpp : implementation file
//
#include "stdafx.h"
#include "PosManager.h"
#include "MsgDealDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define MSG_READ 0
#define MSG_WRITE 1
#define WM_COM_MSG WM_USER+100
#define WM_COM_READ WM_USER+102
/////////////////////////////////////////////////////////////////////////////
// CMsgDealDlg dialog
CMsgDealDlg::CMsgDealDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMsgDealDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMsgDealDlg)
m_start = _T("");
m_scm = _T("");
m_probe = _T("");
m_control = _T("");
m_end = _T("");
m_command = _T("");
//}}AFX_DATA_INIT
}
void CMsgDealDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMsgDealDlg)
DDX_Control(pDX, IDC_LIST1, m_list);
DDX_Text(pDX, IDC_EDIT1, m_start);
DDX_Text(pDX, IDC_EDIT2, m_scm);
DDX_Text(pDX, IDC_EDIT3, m_probe);
DDX_Text(pDX, IDC_EDIT4, m_control);
DDX_Text(pDX, IDC_EDIT5, m_end);
DDX_Text(pDX, IDC_EDIT6, m_command);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMsgDealDlg, CDialog)
//{{AFX_MSG_MAP(CMsgDealDlg)
ON_BN_CLICKED(IDC_BUTTON2, OnSaveItem)
ON_BN_CLICKED(IDOK, OnSend)
ON_BN_CLICKED(IDC_BUTTON1, OnGenerate)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_COM_READ,OnComRead)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMsgDealDlg message handlers
void CMsgDealDlg::OnSaveItem()
{
// TODO: Add your control notification handler code here
}
LRESULT CMsgDealDlg::OnComRead()
{
CString sTime,sYear,sMonth,sDay;
SYSTEMTIME CurTime;
GetLocalTime(&CurTime);
sYear.Format("%d年",CurTime.wYear);
sMonth.Format("%d月",CurTime.wMonth);
sDay.Format("%d日",CurTime.wDay);
sTime = sYear+ sMonth + sDay;
// CurTime.wHour
// CurTime.wMinute
// CurTime.wSecond IBM的
AfxMessageBox(sTime);
return 0L;
}
void CMsgDealDlg::OnSend()
{
m_pParent->PostMessage(WM_COM_MSG,MSG_WRITE,2456);
}
BOOL CMsgDealDlg::Create(UINT nID, CWnd* pParentWnd)
{
// TODO: Add your specialized code here and/or call the base class
m_pParent=pParentWnd;
return CDialog::Create(IDD, pParentWnd);
}
void CMsgDealDlg::OnGenerate()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_command=m_start+m_scm+m_probe+m_control+m_end;
UpdateData(false);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -