hlsock.h

来自「VC++高级编程技巧与示例」· C头文件 代码 · 共 95 行

H
95
字号
#if !defined(AFX_HLSOCK_H__FF747E1D_0DE9_4235_900A_134E53F74E79__INCLUDED_)
#define AFX_HLSOCK_H__FF747E1D_0DE9_4235_900A_134E53F74E79__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// HLSock.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CRWSock command target
#include "Math.h"
#include "Afxtempl.h"
#include "winuser.h"

#define CLT_CLOSE   WM_USER+1
#define CLT_TALKING WM_USER+2

typedef struct 
{
	char m_strName[255]; //客户名字;
	char m_strAction[255];//当前操作;
	BOOL m_bOnline;    //客户是否在线;
	BOOL m_bAngular;   //是否是角度制;
	double m_dbData;   //数据;
}_DATA;

class CRWSock : public CSocket
{
// Attributes
public:

// Operations
public:
	CRWSock();
	virtual ~CRWSock();

// Overrides
public:
	double Calculate(double x);
	_DATA m_Dat;
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRWSock)
	public:
	virtual void OnReceive(int nErrorCode);
	//}}AFX_VIRTUAL

	// Generated message map functions
	//{{AFX_MSG(CRWSock)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

// Implementation
protected:
};

/////////////////////////////////////////////////////////////////////////////
// CLSock command target

class CLSock : public CSocket
{
// Attributes
public:
	CPtrList m_RWSocks;
// Operations
public:
	CLSock();
	virtual ~CLSock();

// Overrides
public:
	void CloseSocket(CRWSock * pSocket);
	void CloseAllSockets();
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLSock)
	public:
	virtual void OnAccept(int nErrorCode);
	//}}AFX_VIRTUAL

	// Generated message map functions
	//{{AFX_MSG(CLSock)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

// Implementation
protected:
};

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_HLSOCK_H__FF747E1D_0DE9_4235_900A_134E53F74E79__INCLUDED_)

⌨️ 快捷键说明

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