📄 talktcpdlg.h
字号:
// TalkTCPDlg.h : header file
//
#if !defined(AFX_TALKTCPDLG_H__C4EDE77B_D846_4873_8931_3B4D2FD276DB__INCLUDED_)
#define AFX_TALKTCPDLG_H__C4EDE77B_D846_4873_8931_3B4D2FD276DB__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CTalkTCPDlg dialog
class CTalkTCPDlg : public CDialog
{
// Construction
public:
CTalkTCPDlg(CWnd* pParent = NULL); // standard constructor
//相关变量
char m_datatype;//接受数据类型/F-文件,D-关闭,M-消息
CString m_strLocalName,m_strRemoteName; //本地和对方的计算机名称
BOOL Receive;
BOOL Busy,Busy1,Listened;
CSocket sockClient;
UINT m_timer;
CSocket sockSrvr;
int createSucceed;
CSocket recSo;
SOCKADDR_IN client;
int iAddrSize;
//相关函数
int GetIpAddress(const CString & sHostName,CString & sIpAddress); //获取本机IP
int GetLocalHostName(CString &sHostName); //获取本机计算机名
int GetNamebyAddress(const CString &IpAddress,CString &sYouName); //获取对方计算机名称
int ProcessReceivedMessage(); //处理收到消息的函数
// Dialog Data
//{{AFX_DATA(CTalkTCPDlg)
enum { IDD = IDD_TALKTCP_DIALOG };
CEdit m_CtrlMessage;
CString m_strIPLocal;
CString m_strIPRemote;
CString m_strMessage;
CString m_strSend;
int m_nPortLocal;
int m_nPortRemote;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTalkTCPDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CTalkTCPDlg)
virtual BOOL OnInitDialog();
afx_msg void OnListen();
afx_msg void OnSendMessage();
afx_msg void OnClearMessage();
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TALKTCPDLG_H__C4EDE77B_D846_4873_8931_3B4D2FD276DB__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -