mytcpserverdlg.h

来自「WinCE EVC4.2 TCP/IP服务器端程序,可以监听客户端的信号,并对每」· C头文件 代码 · 共 67 行

H
67
字号
// MyTCPServerDlg.h : header file
//

#if !defined(AFX_MYTCPSERVERDLG_H__CD0786A6_1BE0_4B1D_BA21_3B77FC72E3BE__INCLUDED_)
#define AFX_MYTCPSERVERDLG_H__CD0786A6_1BE0_4B1D_BA21_3B77FC72E3BE__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

/////////////////////////////////////////////////////////////////////////////
// CMyTCPServerDlg dialog
#include "TCPServer_CE.h"
#include "TCPCustom_CE.h"

class CMyTCPServerDlg : public CDialog
{
// Construction
public:
	CMyTCPServerDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CMyTCPServerDlg)
	enum { IDD = IDD_MYTCPSERVER_DIALOG };
	int		m_localPort;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyTCPServerDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMyTCPServerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnBtnlisten();
	afx_msg void OnBtnclose();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	//定义CTCPServer_CE对象
	CTCPServer_CE m_tcpServer;
private:
	//客户端连接建立事件处理函数
	static void CALLBACK	OnClientConnect(CWnd* pWnd,CTCPCustom_CE *pTcpCustom);
	//客户端SOCKET关闭事件处理函数
	static void  CALLBACK OnClientClose(CWnd* pWnd,CTCPCustom_CE*pTcpCustom);
	//服务器端收到来自客户端的数据
	static  void CALLBACK OnClientRead(CWnd* pWnd,CTCPCustom_CE* pTcpCustom,const char * buf,int len );
	//客户端Socket错误事件处理函数
	static  void CALLBACK OnClientError(CWnd* pWnd,CTCPCustom_CE* pTcpCustom,int nErrorCode);
	
	//服务器端Socket错误事件处理函数
	static void CALLBACK OnServerError(CWnd* pWnd,CTCPServer_CE* pTcpServer_CE,int nErrorCode);

};

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

#endif // !defined(AFX_MYTCPSERVERDLG_H__CD0786A6_1BE0_4B1D_BA21_3B77FC72E3BE__INCLUDED_)

⌨️ 快捷键说明

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