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

📄 tcpclientdlg.h

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

#if !defined(AFX_TCPCLIENTDLG_H__A6C77C53_3582_4C2C_ABD4_3FD043D4FF29__INCLUDED_)
#define AFX_TCPCLIENTDLG_H__A6C77C53_3582_4C2C_ABD4_3FD043D4FF29__INCLUDED_

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

#include "TCPClient_CE.h"

/////////////////////////////////////////////////////////////////////////////
// CTCPClientDlg dialog

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

// Dialog Data
	//{{AFX_DATA(CTCPClientDlg)
	enum { IDD = IDD_TCPCLIENT_DIALOG };
	CString	m_strRemoteIP;
	int		m_nRemotePort;
	CString	m_strSend;
	CString	m_strRecv;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CTCPClientDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnBtnOpen();
	afx_msg void OnBtnClose();
	afx_msg void OnBtnSend();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	// 定义CTCPClient_CE对象
	CTCPClient_CE m_tcpClient;
	//连接断开事件处理函数
	static void CALLBACK OnDisConnect(CWnd* pWnd);
	//当有数据接收事件处理函数
	static void CALLBACK OnRead(CWnd* pWnd,const char * buf,int len );
	//Socket错误事件处理函数
	static void CALLBACK OnError(CWnd* pWnd,int nErrorCode);
	//得到本地的IP地址
	CString GetLocalIP();

};

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

#endif // !defined(AFX_TCPCLIENTDLG_H__A6C77C53_3582_4C2C_ABD4_3FD043D4FF29__INCLUDED_)

⌨️ 快捷键说明

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