serialthread.hpp

来自「此源代码是基于VC++开发的使用Win32创建串口通讯程序程序」· HPP 代码 · 共 69 行

HPP
69
字号
/********************************************************************
	created:	2002/09/18
	created:	18:9:2002   21:05
	filename: 	C:\Development c++\Serial communication\SerialApp\serialThread.hpp
	file path:	C:\Development c++\Serial communication\SerialApp
	file base:	serialThread
	file ext:	hpp
	author:		Chaiyasit T.
	
	purpose:	
*********************************************************************/

#ifndef SERIALTHREAD_HPP
#define SERIALTHREAD_HPP

// class SerialThread
//-----------------------------------------------------------------------------
// Description: This class is inherited from CWinThread, use to handle in part 
//              of thread process (muliti tasking).
// 


class CSerialAppDlg;              // Forward Declaration.

class SerialThread : public CWinThread
{
public:
  // To enable objects of CObject-derived classes to be created dynamically at 
  // run timeto enable objects of CObject-derived classes to be created 
  // dynamically at run time
  DECLARE_DYNCREATE(SerialThread)  
   
  SerialThread ();               // Constructor.
  virtual ~SerialThread();       // Destructor.
public:
  virtual BOOL InitInstance();   // virtual function that derive from base-class.
  virtual int Run();             // virtual function that derive from base-class.  

  void setOwner(CSerialAppDlg* ptrDialog)
  {ptrDlg = ptrDialog;}          // Assign the pointer to pointerDlg is as agent 
                                 // of Class CSerialAppDlg.
private:
  CSerialAppDlg* ptrDlg;         // The pointer that pointer to object CSerialAppDlg. 

};


// class SCC
//-----------------------------------------------------------------------------
// Description: This class is as the interface that is used to access the object
//              of Class SerialCtl.
//
class SCC
{
public:
  SCC() {};   // Constructor.
  ~SCC() {};  // Destructor.
public:
  static SerialCtl& serialCtl() // Implement as the singleton funciton.
  {
    static SerialCtl serial;
    return serial;
  }
};


#endif //SERIALTHREAD_HPP

/****************************End of file**************************************/

⌨️ 快捷键说明

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