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

📄 lx1dlg.h

📁 这是一个用VC编写的工程
💻 H
字号:
// lx1Dlg.h : header file
//
#include "Server.h"

#if !defined(AFX_LX1DLG_H__7B0FD20A_6926_4081_86EC_2D51E947B336__INCLUDED_)
#define AFX_LX1DLG_H__7B0FD20A_6926_4081_86EC_2D51E947B336__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CLx1Dlg dialog

class CLx1Dlg : public CDialog
{
// Construction
public:
	CLx1Dlg(CWnd* pParent = NULL);
	// standard constructor
	CServer m_server;
	CServer m_recv; 
	void ShowAccept()
{
	m_server.Accept(m_recv);
	AfxMessageBox("Server端连接成功");
	m_send.EnableWindow(TRUE);			//	连接成功,可以发送
    m_sendfile.EnableWindow(TRUE);	
}
	void ShowMsg()
{
	char buf[255];
	m_recv.Receive(buf,255);			//接收消息到buf里面,长度255字节。
	CString msg;
	msg.Format("%s", buf);			//用AfxMessageBox函数显示接收到的字符窜。
//	AfxMessageBox(msg);		
	//这里注意CString类的用法
    m_list.InsertString(-1,"对方说:");
	m_list.InsertString(-1,msg);
}




// Dialog Data
	//{{AFX_DATA(CLx1Dlg)
	enum { IDD = IDD_LX1_DIALOG };
	CButton	m_sendfile;
	CButton	m_receivefile;
	CListBox	m_list;
	CButton	m_send;
	CButton	m_listen;
	CEdit	m_ctrl;
	CButton	m_connect;
	CString	m_msg;
	CString	m_ip;
	CString	m_loginname;
	CString	m_password;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CLx1Dlg)
	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 OnSend();
	afx_msg void OnConnect();
	afx_msg void OnSendFile();
	afx_msg void OnReceiveFile();
	afx_msg void OnButton1();
	afx_msg void OnLogin();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_LX1DLG_H__7B0FD20A_6926_4081_86EC_2D51E947B336__INCLUDED_)

⌨️ 快捷键说明

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