comthrd.cpp

来自「gps对时」· C++ 代码 · 共 59 行

CPP
59
字号
// ComThrd.cpp : implementation file
//

#include "stdafx.h"
#include "RegionComm.h"
#include "ComThrd.h"
#include "Communication.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CComThrd

IMPLEMENT_DYNCREATE(CComThrd, CWinThread)

CComThrd::CComThrd()
{
	m_pOwner=NULL;
}

CComThrd::~CComThrd()
{
}

BOOL CComThrd::InitInstance()
{	
	return TRUE;
}

int CComThrd::ExitInstance()
{
	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(CComThrd, CWinThread)
	//{{AFX_MSG_MAP(CComThrd)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CComThrd message handlers

int CComThrd::Run() 
{
    if(m_pOwner==NULL)
		return(0);
    m_pOwner->TryToReadAllComm();
	return(1);
}

void CComThrd::SetOwner(CCommunication* pOwner)
{
	m_pOwner = pOwner;
}

⌨️ 快捷键说明

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