📄 mainthread.h
字号:
#if !defined(AFX_MAINTHREAD_H__DA7EEEC8_2BBC_4ED0_B390_400BC86E87FB__INCLUDED_)
#define AFX_MAINTHREAD_H__DA7EEEC8_2BBC_4ED0_B390_400BC86E87FB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MainThread.h : header file
//
#include "afxmt.h"
#include <afxsock.h>
#include "ProcTcpClientThread.h"
#include "IvrServerDoc.h"
class CIvrServerDoc;
/////////////////////////////////////////////////////////////////////////////
// CMainThread thread
class CMainThread : public CWinThread
{
DECLARE_DYNCREATE(CMainThread)
protected:
CMainThread(); // protected constructor used by dynamic creation
CEvent StopEvent;
struct sockaddr_in srv_addr; //定义公用的服务器地址结构体
int ServerSock; //定义公用的服务器套接子
struct sockaddr_in cli_addr;
int addrlen;
// Attributes
public:
CIvrServerDoc * m_pDoc;
int iServerPort;
public:
//add you code at here
//被外部进程或线程调用,以中止本线程
void StopThread();
//线程启动后的执行函数体
virtual int Run( );
//中止本线程产生的所有UDP,TCP服务线程
/*以上声明请勿改动*/
// Operations
public:
int OnProcessAccpt();
int OnCreatSock();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CMainThread();
// Generated message map functions
//{{AFX_MSG(CMainThread)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINTHREAD_H__DA7EEEC8_2BBC_4ED0_B390_400BC86E87FB__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -