?? comthread.cpp
字號:
// ComThread.cpp : implementation file
//
#include "stdafx.h"
#include "MoblieX.h"
#include "ComThread.h"
#include "moblieXDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CComThread
IMPLEMENT_DYNCREATE(CComThread, CWinThreadEx)
CComThread::CComThread()
{
}
CComThread::~CComThread()
{
}
BEGIN_MESSAGE_MAP(CComThread, CWinThreadEx)
//{{AFX_MSG_MAP(CComThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CComThread message handlers
void CComThread::Process()
{
HANDLE hComm = m_pDoc->m_hComm;
if( !(m_pDoc->IsCommPortOpen()) )
{//串口都沒打開, 搞什么名堂
return;
}
while( !m_isAborting )
{
if( m_pDoc->MakeCurSendStr() )
{//有字串要發送
m_pDoc->CommSendCurStr();
}
if( m_pDoc->CommReadStr() )
{//沒有出錯
::PostMessage( m_hwndNotify, WM_COMMAND, ID_COMM_READ_OK, 0 );
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -