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

📄 thread.h

📁 串口通信mfc源码
💻 H
字号:
// ***************************************************************
//  Thread   version:  1.0   ·  date: 06/30/2006
//  -------------------------------------------------------------
//  Wrapper Thread operation
//  -------------------------------------------------------------
//  Copyright (C) 2001-2006 - Midapexsoft All Rights Reserved
// ***************************************************************
// 
// ***************************************************************
#pragma once

class CThread
{
public:
	CThread();
	virtual ~CThread();

	HANDLE GetHandle() const;
	void Wait() const;
	bool Wait(DWORD timeoutMillis) const;
	void Start();
	void Terminate(DWORD exitCode = 0);
	void SetPriority(int priority);

	unsigned int  GetThreadID() const { return m_dwId;}
	
protected:
	//it can be overrided for your purpose
	virtual int Run() = 0; 

private :
	static unsigned int __stdcall ThreadFunction(void *pV);
	HANDLE m_hThread;
	unsigned int  m_dwId;

	// No copies
	CThread(const CThread &rhs);
	CThread &operator=(const CThread &rhs);
};


⌨️ 快捷键说明

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