- // MainFrm.h : interface of the CMainFrame class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_MAINFRM_H__E6C940E7_31C3_4826_8A9D_B01184F08820__INCLUDED_)
- #define AFX_MAINFRM_H__E6C940E7_31C3_4826_8A9D_B01184F08820__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "MyStringArray.h"
- #include "MapView.h"
- #include "NetMapView.h"
- #include "VlanView.h"
- #include "MyImage.h"
- #include <AfxTempl.h>
- class CMainFrame : public CFrameWnd
- {
- protected: // create from serialization only
- CMainFrame();
- DECLARE_DYNCREATE(CMainFrame)
- // Attributes
- public:
- HTREEITEM HRoot;
- HTREEITEM HCurrent;
- HTREEITEM HSelect;
- CArray <HTREEITEM,HTREEITEM> NodeArray;
- //为简化树的遍历,维护一个树中所有节点句柄组成的动态数组;
- CSplitterWnd h,v;
- //分割主窗口;
- CMapView *pListView;
- CNetMapView *pNetMapView;
- CVlanView *pVlanView;
- //保存指向三个视图的指针;
- MyStringArray m_snmp;
- struct neighbor
- {
- HTREEITEM Id;
- //邻居节点的句柄;
- CString localport;
- CString remoteport;
- };
- //保存连接信息的结构,一个节点的每个物理连接对应这样的一个结构。
- //由于一个节点的连接数目不确定,因此下面的结构中将这个结构作为
- //一个动态数组中的元素定义;
- struct NodeData
- {
- CString ip;
- CString sysDescr;
- bool scan;
- int level;
- int position;
- bool router;
- CMyImage *pImage;
- CArray <neighbor,neighbor&> m_neighbor;
- };
- //用来存放节点信息的结构;
- NodeData *pNodeData;
- //指向该结构的指针;
- //
- // Operations
- public:
- HTREEITEM FindNode(HTREEITEM hSubRoot,const CString &text);
- bool Findport(CString &port,NodeData *p);
- CString HtoIP(CString Hex);
- //将16进制的IP地址转化为正常格式的函数;
- void ScanNode(CString &add,CString &community,HTREEITEM hparent);
- //扫描一个节点,并处理所得到的CDP条目的函数;
- BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
- //分割窗口需要的函数;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMainFrame)
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CMainFrame();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected: // control bar embedded members
- CStatusBar m_wndStatusBar;
- CToolBar m_wndToolBar;
- // Generated message map functions
- protected:
- //{{AFX_MSG(CMainFrame)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnScan();
- afx_msg void OnGraph();
- afx_msg void OnShowinformation();
- afx_msg void OnNodeModify();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_MAINFRM_H__E6C940E7_31C3_4826_8A9D_B01184F08820__INCLUDED_)