?? edtlog.cpp
字號:
// edtlog.cpp : implementation file
//
#include "stdafx.h"
#include "ComPort.h"
#include "edtlog.h"
#include "ComPortDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Cedtlog
Cedtlog::Cedtlog()
{
EnableAutomation();
}
Cedtlog::~Cedtlog()
{
}
void Cedtlog::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CEdit::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(Cedtlog, CEdit)
//{{AFX_MSG_MAP(Cedtlog)
ON_WM_CHAR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(Cedtlog, CEdit)
//{{AFX_DISPATCH_MAP(Cedtlog)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_Iedtlog to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {43D37375-8514-4E8F-B92F-6C9DDB6B84BC}
static const IID IID_Iedtlog =
{ 0x43d37375, 0x8514, 0x4e8f, { 0xb9, 0x2f, 0x6c, 0x9d, 0xdb, 0x6b, 0x84, 0xbc } };
BEGIN_INTERFACE_MAP(Cedtlog, CEdit)
INTERFACE_PART(Cedtlog, IID_Iedtlog, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Cedtlog message handlers
void Cedtlog::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CComPortDlg* pDlg = static_cast<CComPortDlg*>(this->GetParent());
char c = (char)nChar;
if(!pDlg->m_bConnected)
{
AfxMessageBox("串口沒有連接!");
return;
}
pDlg->m_bisonchar = TRUE;
//MessageBox("ON CHAR");
pDlg->SendCom(&c, 1);
// CEdit::OnChar(nChar, nRepCnt, nFlags);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -