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

📄 tcptalkdlg.h

📁 基于EVC的wince下的TCP消息收发程序
💻 H
字号:
// TCPTalkDlg.h : header file
//

#if !defined(AFX_TCPTALKDLG_H__3BB5180D_530C_440A_86C8_02FB57C7B0D5__INCLUDED_)
#define AFX_TCPTALKDLG_H__3BB5180D_530C_440A_86C8_02FB57C7B0D5__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CTCPTalkDlg dialog

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

	//相关变量
	char m_datatype;//接受数据类型/F-文件,D-关闭,M-消息
	CString m_strLocalIP,m_strRemoteIP; //本地和对方的IP地址
	CString m_strLocalName,m_strRemoteName; //本地和对方的计算机名称
	BOOL Receive;
	BOOL Busy;


	//相关函数
	int GetIpAddress(const CString & sHostName,CString & sIpAddress); //获取本机IP
	int GetLocalHostName(CString &sHostName); //获取本机计算机名
	int GetNamebyAddress(const CString &IpAddress,CString &sYouName); //获取对方计算机名称
	int ProcessReceivedMessage(CSocket &recSo,SOCKADDR_IN &client); //处理收到消息的函数

// Dialog Data
	//{{AFX_DATA(CTCPTalkDlg)
	enum { IDD = IDD_TCPTALK_DIALOG };
	CEdit	m_CtrlMessage;
	CIPAddressCtrl	m_CtrlRemoteIP;
	CIPAddressCtrl	m_CtrlLocalIP;
	int		m_nPortLocal;
	int		m_nPortRemote;
	CString	m_strMessage;
	CString	m_strSend;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CTCPTalkDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnListen();
	afx_msg void OnSendMessage();
	afx_msg void OnClearMessage();
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_TCPTALKDLG_H__3BB5180D_530C_440A_86C8_02FB57C7B0D5__INCLUDED_)

⌨️ 快捷键说明

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