⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netcomthread.cpp

📁 用算法来实现一个收费系统
💻 CPP
字号:
// NetComThread.cpp : implementation file
//

#include "stdafx.h"
#include "LaneSoft.h"
#include "MainFrm.h"
#include "NetComThread.h"
#include "NetComManger.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNetComThread

IMPLEMENT_DYNCREATE(CNetComThread, CWinThread)

CNetComThread::CNetComThread()
{
	m_pNetCom = new CNetComManger;
}

CNetComThread::~CNetComThread()
{
	delete m_pNetCom;
}

BOOL CNetComThread::InitInstance()
{
	// TODO:  perform and per-thread initialization here

	return TRUE;
}

int CNetComThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here

	return CWinThread::ExitInstance();
}
LONG CNetComThread::OnTimerClock(UINT wParam,LONG lParam)
{
	m_pNetCom->SecondDuty();

	//	m_pNetCom->TxjSecondDuty() ;
	return 0;
}
LONG CNetComThread::OnTimerTxjClock(UINT wParam,LONG lParam)
{
//	m_pNetCom->SecondDuty();
	m_pNetCom->TxjSecondDuty() ;
	return 0;
}



LONG CNetComThread::OnKey(UINT wParam,LONG lParam)
{
	m_pData_Use = (Data_Use *) lParam;
	m_pNetCom->netSendMsg((Data_Use *)m_pData_Use,sizeof(Data_Use));
	return 0;
}
LONG CNetComThread::OnKeyTxj(UINT wParam,LONG lParam)
{
	m_pData_Use = (Data_Use *) lParam;
	m_pNetCom->TxjnetSendMsg((Data_Use *)m_pData_Use,sizeof(Data_Use));
//	m_pNetCom->TxjnetSendMsg();
	return 0;
}

BEGIN_MESSAGE_MAP(CNetComThread, CWinThread)
	//{{AFX_MSG_MAP(CNetComThread)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		ON_THREAD_MESSAGE(WM_TIME_COLOCK,OnTimerClock)
		ON_THREAD_MESSAGE(WM_KEY_USE,OnKey)
		ON_THREAD_MESSAGE(WM_TIMETXJ_COLOCK,OnTimerTxjClock)
		ON_THREAD_MESSAGE(WM_KEYTXJ_USE,OnKeyTxj)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNetComThread message handlers

⌨️ 快捷键说明

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