serverview.h

来自「网吧管理系统VC源码」· C头文件 代码 · 共 118 行

H
118
字号
// ServerView.h : interface of the CServerView class
//
/////////////////////////////////////////////////////////////////////////////
#include "ServerDoc.h"

#if !defined(AFX_SERVERVIEW_H__B663FC1A_CEBD_45AB_94F7_E88E74069EEB__INCLUDED_)
#define AFX_SERVERVIEW_H__B663FC1A_CEBD_45AB_94F7_E88E74069EEB__INCLUDED_

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

class CDaoRecord;
struct SMessage;
#include "CommSocket.h"
#include "ViewMsgDlg.h"

enum Client_Status { CLIENT_UNKNOW=0, CLIENT_INFORMATION=1, CLIENT_WORKING=2, CLIENT_LOCKING=3, CLIENT_WAITING, CLIENT_ALL_NIGHT};

static CString EncryptText(CString strText)
{
	char *KeyWords[] = {"%$<]A", "45B%c{", "AcFag^*", "<[/\09L!", "#$@86127&j",
				   ",:.zxy?|\\+", "-ab43.B<>}]", "&QwfghmA$@#*", "*$%fFE@><?.,i",
				   "FEadeef#&^%>*(", "KIeS|+)&^ie2289"
	};
	int strLength = strText.GetLength();
	char  strBuff[15];
	CString strPassword;
	int Ascii;

	for(int i = 0; i < strLength; i++)
	{
		char temp = strText.GetAt(i);
		Ascii = temp;
		char c = KeyWords[strLength - 5][(i % strLength) + 1];
        Ascii = Ascii + c;
        strBuff[i] = (Ascii & 0xffff);
	}
	strBuff[i] = '\0';
	strPassword = strBuff;
	return strPassword;
}


class CServerView : public CListView
{
protected: // create from serialization only
	DECLARE_DYNCREATE(CServerView)

// Attributes
public:
	CServerView();
	CServerDoc* GetDocument();
	CMenuEx m_contextMenu;
	BOOL m_bUpdate;
	CString m_strRegion;
	CDaoRecord* m_pDaoRecord;
	CDaoHistoryFree* m_pDaoRecordFree;

// Operations
public:
	void ReceiveData(SMessage& msg, CCommSocket* pCommSocket);
	void Refurbish(int iRecordNum);
	void Refurbish(CString strName);
	void AddViewItem(char* pName);
	void SetSelectState(CString & strName);
	void SetSelectState(char * pName);
	void AddViewItem(CString &strName);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CServerView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	//}}AFX_VIRTUAL

// Implementation
public:
	CString ConvertString(int ntemp);
	virtual ~CServerView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CServerView)
	afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in ServerView.cpp
inline CServerDoc* CServerView::GetDocument()
   { return (CServerDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_SERVERVIEW_H__B663FC1A_CEBD_45AB_94F7_E88E74069EEB__INCLUDED_)

⌨️ 快捷键说明

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