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

📄 eventview.h

📁 一个modbus协议的opc server
💻 H
字号:
#if !defined(AFX_EVENTVIEW_H__EDC119CC_F7A1_4401_AE2E_A02BA470E288__INCLUDED_)
#define AFX_EVENTVIEW_H__EDC119CC_F7A1_4401_AE2E_A02BA470E288__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EventView.h : header file
//
#include <afxcview.h>
#include <afxmt.h>
#include "globals.h"
#include "timestmp.h"
/////////////////////////////////////////////////////////////////////////////
// CEventView view

class CKEvent;

class CEventView : public CListView
{
public:
	CEventView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CEventView)
    virtual ~CEventView();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEventView)
	public:
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL
protected:
    CCriticalSection m_csLog;

	CKEvent **m_pEventList;
	int m_cnEvents;
	int m_cnAllocEvents;

	CKEvent **m_pPendingEventList;
	int m_cnPendingEvents;
	int m_cnPendingAllocEvents;

	bool m_bAutoScroll;
	bool m_bLogErrorsOnly;

	CImageList m_cImageList;

// Implementation
public:
    void LogMsg (EVENTTYPE eType, LPCTSTR lpszMessage);
    
    int GetEventCount () {return (m_cnEvents);}
    bool LogErrorsOnly () {return (m_bLogErrorsOnly);}
    
protected:
    bool AddEvent (CKEvent *pEvent);


#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CEventView)
	afx_msg void OnDestroy();
	afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnViewClear();
	afx_msg void OnViewErroronly();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

// **************************************************************************
// Define a class to contain information about an event and to aid in 
// creating strings describing the event.
// **************************************************************************
class CKEvent
{
public:
    CKEvent () {}
    CKEvent (LPCTSTR lpszMessage, EVENTTYPE eType)
    {
        m_strMsg = lpszMessage;
        m_eType = eType;
        m_cTimeStamp.Assign ();
    }
    
    LPCTSTR GetMessage () {return (m_strMsg);}
    EVENTTYPE GetType () {return (m_eType);}
    
    void FormatDate (LPTSTR lpsz, int cnBytes) {m_cTimeStamp.FormatDate (lpsz, cnBytes);}
    void FormatTime (LPTSTR lpsz, int cnBytes) {m_cTimeStamp.FormatTime (lpsz, cnBytes, true);}
    
private:
    CString m_strMsg;
    CTimeStamp m_cTimeStamp;
    EVENTTYPE m_eType;
};

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

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

#endif // !defined(AFX_EVENTVIEW_H__EDC119CC_F7A1_4401_AE2E_A02BA470E288__INCLUDED_)

⌨️ 快捷键说明

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