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

SNMP编程

开发平台:

Visual C++

  1. // MibBrowserView.h : interface of the CMibBrowserView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MIBBROWSERVIEW_H__3086358A_18D2_4590_94D8_4F8EA0B51C49__INCLUDED_)
  5. #define AFX_MIBBROWSERVIEW_H__3086358A_18D2_4590_94D8_4F8EA0B51C49__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CMibBrowserView : public CFormView
  10. {
  11. protected: // create from serialization only
  12. CMibBrowserView();
  13. DECLARE_DYNCREATE(CMibBrowserView)
  14. public:
  15. //{{AFX_DATA(CMibBrowserView)
  16. enum { IDD = IDD_MIBBROWSER_FORM };
  17. CEdit m_oid;
  18. CEdit m_community;
  19. CIPAddressCtrl m_ipadd;
  20. CTreeCtrl m_tree;
  21. CListCtrl m_list;
  22. CString m_edit1;
  23. //}}AFX_DATA
  24. // Attributes
  25. public:
  26. CMibBrowserDoc* GetDocument();
  27. // Operations
  28. public:
  29. // Overrides
  30. // ClassWizard generated virtual function overrides
  31. //{{AFX_VIRTUAL(CMibBrowserView)
  32. public:
  33. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  34. protected:
  35. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  36. virtual void OnInitialUpdate(); // called first time after construct
  37. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  38. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  39. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  40. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  41. //}}AFX_VIRTUAL
  42. // Implementation
  43. public:
  44. virtual ~CMibBrowserView();
  45. #ifdef _DEBUG
  46. virtual void AssertValid() const;
  47. virtual void Dump(CDumpContext& dc) const;
  48. #endif
  49. protected:
  50. CString CurrDir;
  51. CImageList m_iImageList;
  52. HTREEITEM HRoot;
  53. HTREEITEM HSecond;
  54. HTREEITEM HCurrent;
  55. //treeview item;
  56. struct MibNode
  57. {
  58.    CString PSnytax;
  59.    CString PAccess;
  60.    CString PStatus;
  61.    CString PDescr;
  62.    CString PIndex;
  63.    CString POid;
  64.    CStringList * PInteger;
  65. };
  66. MibNode Mibdata;
  67. //treeview data;
  68. CStringList TopOid;
  69. CStdioFile MibFile;
  70. CString Line;
  71. CString IndexString;
  72. //Procedures;
  73. //searching for a node in a sub_tree which label is text,
  74. //if find,return the handle of the node,ortherwise,NULL;
  75. bool LoadMib(CString &filename);
  76. HTREEITEM SearchNode(const CString &OidStr);
  77. void AddObject(HTREEITEM ht,CString &Parent_name,
  78.  CString &Child_name,CString &num,MibNode* p);
  79. void travl(HTREEITEM hparent);
  80. void InitNodeData(MibNode *Pnode);
  81. HTREEITEM FindNode(HTREEITEM hSubRoot,const CString &text);
  82. void AddPlaceHolder(HTREEITEM ht,CString &Parent_name,
  83. CString &Child_name,CString &num);
  84. void WorkOnInt(CString &str,CStringList* p);
  85. //for reading mib file;
  86. // Generated message map functions
  87. protected:
  88. //{{AFX_MSG(CMibBrowserView)
  89. afx_msg void OnGet();
  90. afx_msg void OnGetnext();
  91. afx_msg void OnGetsubtree();
  92. afx_msg void OnWalk();
  93. afx_msg void OnDestroy();
  94. afx_msg void OnItemexpandedTree1(NMHDR* pNMHDR, LRESULT* pResult);
  95. afx_msg void OnSelchangedTree1(NMHDR* pNMHDR, LRESULT* pResult);
  96. afx_msg void OnLoad();
  97. afx_msg void OnOid();
  98. afx_msg void OnSave();
  99. afx_msg void OnSet();
  100. //}}AFX_MSG
  101. DECLARE_MESSAGE_MAP()
  102. };
  103. #ifndef _DEBUG  // debug version in MibBrowserView.cpp
  104. inline CMibBrowserDoc* CMibBrowserView::GetDocument()
  105.    { return (CMibBrowserDoc*)m_pDocument; }
  106. #endif
  107. /////////////////////////////////////////////////////////////////////////////
  108. //{{AFX_INSERT_LOCATION}}
  109. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  110. #endif // !defined(AFX_MIBBROWSERVIEW_H__3086358A_18D2_4590_9