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

📄 tcpserverdlg.h

📁 WinCE下利用TCP进行网络通讯的例子
💻 H
字号:
// TCPServerDlg.h : header file
//

#if !defined(AFX_TCPSERVERDLG_H__6F789EAF_40BB_4DB0_81CA_AF15E9C8018E__INCLUDED_)
#define AFX_TCPSERVERDLG_H__6F789EAF_40BB_4DB0_81CA_AF15E9C8018E__INCLUDED_

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

#include "TCPServer_CE.h"
#include "TCPCustom_CE.h"

/////////////////////////////////////////////////////////////////////////////
// CTCPServerDlg dialog

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

// Dialog Data
	//{{AFX_DATA(CTCPServerDlg)
	enum { IDD = IDD_TCPSERVER_DIALOG };
	int		m_nServerPort;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CTCPServerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnBtnListen();
	afx_msg void OnBtnClose();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	CTCPServer_CE m_tcpServer;	//定义CTCPServer_CE对象

	static void CALLBACK OnClientConnect(CWnd* pWnd,CTCPCustom_CE *pTcpCustom);		// 客户端连接建立事件处理函数
	static void CALLBACK OnClientClose(CWnd* pWnd,CTCPCustom_CE*pTcpCustom);		// 客户端SOCKET关闭事件处理函数
	static void CALLBACK OnClientRead(CWnd* pWnd,CTCPCustom_CE* pTcpCustom,const char * buf,int len );	// 服务器端收到来自客户端的数据
	static void CALLBACK OnClientError(CWnd* pWnd,CTCPCustom_CE* pTcpCustom,int nErrorCode);		// 客户端Socket错误事件处理函数
	static void CALLBACK OnServerError(CWnd* pWnd,CTCPServer_CE* pTcpServer_CE,int nErrorCode);		// 服务器端Socket错误事件处理函数
};

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

#endif // !defined(AFX_TCPSERVERDLG_H__6F789EAF_40BB_4DB0_81CA_AF15E9C8018E__INCLUDED_)

⌨️ 快捷键说明

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