TrapView.h
上传用户:hbytqc8
上传日期:2014-07-31
资源大小:527k
文件大小:3k
源码类别:

SNMP编程

开发平台:

Visual C++

  1. // TrapView.h : interface of the CTrapView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_TRAPVIEW_H__3A2AFE6A_FA6A_4AF3_B834_A74E7F704B6C__INCLUDED_)
  5. #define AFX_TRAPVIEW_H__3A2AFE6A_FA6A_4AF3_B834_A74E7F704B6C__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #define WM_USERDEFMSG (WM_USER + 101)
  10. #include "snmp_pp.h"
  11. #include "snmp_pp/collect.h"
  12. #include "snmp_pp/notifyqueue.h"
  13. //#include "Mainfrm.h"
  14. #include "TrapDoc.h"
  15. #include "AfxTempl.h"
  16. #include "TrapView.h"
  17. #include "Scan.h"
  18. #include "Message.h"
  19. #include "MyStringArray.h"
  20. class CTrapView : public CFormView
  21. {
  22. protected: // create from serialization only
  23. CTrapView();
  24. DECLARE_DYNCREATE(CTrapView)
  25.   //  void callback( int reason, Snmp *snmp, Pdu &pdu, SnmpTarget &target, void *cd)
  26. public:
  27. //{{AFX_DATA(CTrapView)
  28. enum { IDD = IDD_TRAP_FORM };
  29. CListCtrl m_list1;
  30. CEdit m_text;
  31. CTreeCtrl m_tree;
  32. //}}AFX_DATA
  33. //static CString mymessage;
  34. // Attributes
  35. struct Line
  36. {
  37. CString Index;
  38. CString Name;
  39. CString State;
  40. CString Descr;
  41. CString Ip;
  42. HTREEITEM Ht;
  43. bool Selected;
  44. CString Type;
  45. };
  46. Line * pLine;
  47. CTypedPtrArray <CPtrArray,Line *> LineArray,TempArray;
  48. //int number;
  49. CString TrapMessage;
  50. CImageList m_iImageList;
  51. public:
  52. CTrapDoc* GetDocument();
  53. volatile bool Recive;
  54. CMessage dlg;
  55. //   friend void callme (int reason, Snmp *snmp, Pdu &pdu, SnmpTarget &target, void *cd);
  56. //static void callme (int reason, Snmp *snmp, Pdu &pdu, SnmpTarget &target, void *cd);
  57. // Operations
  58. public:
  59. //void call( int reason, Snmp *snmp, Pdu &pdu, SnmpTarget &target, void *cd);
  60. // Overrides
  61. // ClassWizard generated virtual function overrides
  62. //{{AFX_VIRTUAL(CTrapView)
  63. public:
  64. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  65. protected:
  66. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  67. virtual void OnInitialUpdate(); // called first time after construct
  68. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  69. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  70. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  71. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  72. //}}AFX_VIRTUAL
  73. // Implementation
  74. public:
  75. virtual ~CTrapView();
  76. #ifdef _DEBUG
  77. virtual void AssertValid() const;
  78. virtual void Dump(CDumpContext& dc) const;
  79. #endif
  80. protected:
  81.  MyStringArray m_snmp;
  82. // Generated message map functions
  83. protected:
  84. //{{AFX_MSG(CTrapView)
  85. afx_msg void OnStart();
  86. afx_msg void OnEnd();
  87. afx_msg void OnFinish();
  88. afx_msg void OnConfig();
  89. afx_msg void OnDestroy();
  90. //}}AFX_MSG
  91. DECLARE_MESSAGE_MAP()
  92. };
  93. #ifndef _DEBUG  // debug version in TrapView.cpp
  94. inline CTrapDoc* CTrapView::GetDocument()
  95.    { return (CTrapDoc*)m_pDocument; }
  96. #endif
  97. /////////////////////////////////////////////////////////////////////////////
  98. //{{AFX_INSERT_LOCATION}}
  99. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  100. #endif // !defined(AFX_TRAPVIEW_H__3A2AFE6A_FA6A_4AF3_B834_A74E7F704B6C__INCLUDED_)