MainFrm.cpp
资源名称:hp_snmp3.zip [点击查看]
上传用户:czjinwang
上传日期:2007-01-12
资源大小:2484k
文件大小:5k
源码类别:
SNMP编程
开发平台:
Visual C++
- /*============================================================================
- Copyright (c) 1996
- Hewlett-Packard Company
- ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
- Permission to use, copy, modify, distribute and/or sell this software
- and/or its documentation is hereby granted without fee. User agrees
- to display the above copyright notice and this license notice in all
- copies of the software and any documentation of the software. User
- agrees to assume all liability for the use of the software; Hewlett-Packard
- makes no representations about the suitability of this software for any
- purpose. It is provided "AS-IS without warranty of any kind,either express
- or implied. User hereby grants a royalty-free license to any and all
- derivatives based upon this software code base.
- =============================================================================*/
- #include "stdafx.h"
- #include "browser.h"
- #include "splash.h"
- #include "stats.h"
- #include "targets.h"
- #include "get.h"
- #include "getnext.h"
- #include "set.h"
- #include "notifysend.h"
- #include "notifyreceive.h"
- #include "getbulk.h"
- #include "MainFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- ON_COMMAND(ID_GET, OnGet)
- ON_COMMAND(ID_GETNEXT, OnGetnext)
- ON_COMMAND(ID_SET, OnSet)
- ON_COMMAND(ID_SEND_NOTIFY, OnSendNotify)
- ON_COMMAND(ID_RECEIVE_NOTIFY, OnReceiveNotify)
- ON_COMMAND(ID_TARGET_EDIT, OnTargetEdit)
- ON_COMMAND(ID_STATS, OnStats)
- ON_COMMAND(ID_INFORM, OnInform)
- ON_WM_SHOWWINDOW()
- ON_COMMAND(ID_BULK, OnBulk)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
- CMainFrame::CMainFrame()
- {
- // TODO: add member initialization code here
- Splash splash;
- splash.DoModal();
- }
- CMainFrame::~CMainFrame()
- {
- }
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
- if (!m_wndToolBar.Create(this) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create toolbarn");
- return -1; // fail to create
- }
- m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
- CBRS_TOOLTIPS);
- theApp.mf = this;
- return 0;
- }
- BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CFrameWnd::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CFrameWnd::AssertValid();
- }
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CFrameWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers
- void CMainFrame::OnGet()
- {
- // TODO: Add your command handler code here
- Get *get;
- get = new Get;
- }
- void CMainFrame::OnGetnext()
- {
- // TODO: Add your command handler code here
- GetNext *getnext;
- getnext = new GetNext;
- }
- void CMainFrame::OnSet()
- {
- // TODO: Add your command handler code here
- Set *set;
- set = new Set;
- }
- void CMainFrame::OnSendNotify()
- {
- // TODO: Add your command handler code here
- NotifySend *notifysend;
- notifysend = new NotifySend;
- }
- void CMainFrame::OnReceiveNotify()
- {
- // TODO: Add your command handler code here
- NotifyReceive *notify_receive;
- notify_receive = new NotifyReceive;
- }
- void CMainFrame::OnTargetEdit()
- {
- // TODO: Add your command handler code here
- Targets *targets;
- targets = new Targets("Managed Targets",this);
- targets->Create( this);
- }
- void CMainFrame::OnStats()
- {
- // TODO: Add your command handler code here
- Stats *stats;
- stats = new Stats;
- }
- void CMainFrame::OnInform()
- {
- // TODO: Add your command handler code here
- AfxMessageBox("Operation Not Supported in this Version!");
- }
- void CMainFrame::OnShowWindow(BOOL bShow, UINT nStatus)
- {
- //CFrameWnd::OnShowWindow(bShow, nStatus);
- // TODO: Add your message handler code here
- int x=0;
- }
- void CMainFrame::OnBulk()
- {
- // TODO: Add your command handler code here
- GetBulk *getbulk;
- getbulk = new GetBulk;
- }