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

📄 netview.h

📁 Visual_C++.NET精彩案例237.rar
💻 H
字号:
// netView.h : CNetView类接口
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_NETVIEW_H__5EBA4C74_0351_44B1_82D0_A40635DA152E__INCLUDED_)
#define AFX_NETVIEW_H__5EBA4C74_0351_44B1_82D0_A40635DA152E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxcoll.h>

class CListenSocket;
class CNetDoc;
class CReceiveSocket;
class CNetView : public CView
{
protected: // 仅从序列化创建
	CNetView();
	DECLARE_DYNCREATE(CNetView)

// 属性
public:
	CNetDoc* GetDocument();
	CListenSocket* m_pSocket;//侦听套接字
	CObList ClientSocket_Oblist;//存放客户套接字指针
	CReceiveSocket* pp_Socket;//接收数据套接字
	CStringList cList_msg;//接收信息集合队列
	WSADATA wsa_Now;//初始化winsock库
	SOCKADDR* lpSockAddr;//套接字地址
	BOOL b_Listening;//建立侦听
	
//操作
public:
	void OnListenAccept(WPARAM wParam,LPARAM lParam);//发送侦听到的连接消息

// 重写
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNetView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL
	
// 实现
public:
	void SendFile(CReceiveSocket* pSocket);//发送文件
	void CloseSocket(CReceiveSocket* pSocket);//关闭套接字
	void ReceiveData(CReceiveSocket* pSocket);//接收数据
	virtual ~CNetView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 生成的消息映射函数
protected:
	//{{AFX_MSG(CNetView)
	afx_msg void OnNetSenddata();
	afx_msg void OnUpdateNetSenddata(CCmdUI* pCmdUI);
	afx_msg void OnNetServerstart();
	afx_msg void OnUpdateNetServerstart(CCmdUI* pCmdUI);
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // netView.cpp调试版本
inline CNetDoc* CNetView::GetDocument()
   { return (CNetDoc*)m_pDocument; }
#endif



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

#endif // !defined(AFX_NETVIEW_H__5EBA4C74_0351_44B1_82D0_A40635DA152E__INCLUDED_)

⌨️ 快捷键说明

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