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

SNMP编程

开发平台:

Visual C++

  1. // MibBrowser.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "MibBrowser.h"
  5. #include "MainFrm.h"
  6. #include "MibBrowserDoc.h"
  7. #include "MibBrowserView.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CMibBrowserApp
  15. BEGIN_MESSAGE_MAP(CMibBrowserApp, CWinApp)
  16. //{{AFX_MSG_MAP(CMibBrowserApp)
  17. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  18. // NOTE - the ClassWizard will add and remove mapping macros here.
  19. //    DO NOT EDIT what you see in these blocks of generated code!
  20. //}}AFX_MSG_MAP
  21. // Standard file based document commands
  22. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  23. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  24. // Standard print setup command
  25. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  26. END_MESSAGE_MAP()
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CMibBrowserApp construction
  29. CMibBrowserApp::CMibBrowserApp()
  30. {
  31. // TODO: add construction code here,
  32. // Place all significant initialization in InitInstance
  33. }
  34. /////////////////////////////////////////////////////////////////////////////
  35. // The one and only CMibBrowserApp object
  36. CMibBrowserApp theApp;
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CMibBrowserApp initialization
  39. BOOL CMibBrowserApp::InitInstance()
  40. {
  41. AfxEnableControlContainer();
  42. // Standard initialization
  43. // If you are not using these features and wish to reduce the size
  44. //  of your final executable, you should remove from the following
  45. //  the specific initialization routines you do not need.
  46. #ifdef _AFXDLL
  47. Enable3dControls(); // Call this when using MFC in a shared DLL
  48. #else
  49. Enable3dControlsStatic(); // Call this when linking to MFC statically
  50. #endif
  51. // Change the registry key under which our settings are stored.
  52. // TODO: You should modify this string to be something appropriate
  53. // such as the name of your company or organization.
  54. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  55. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  56. // Register the application's document templates.  Document templates
  57. //  serve as the connection between documents, frame windows and views.
  58. CSingleDocTemplate* pDocTemplate;
  59. pDocTemplate = new CSingleDocTemplate(
  60. IDR_MAINFRAME,
  61. RUNTIME_CLASS(CMibBrowserDoc),
  62. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  63. RUNTIME_CLASS(CMibBrowserView));
  64. AddDocTemplate(pDocTemplate);
  65. // Parse command line for standard shell commands, DDE, file open
  66. CCommandLineInfo cmdInfo;
  67. ParseCommandLine(cmdInfo);
  68. // Dispatch commands specified on the command line
  69. if (!ProcessShellCommand(cmdInfo))
  70. return FALSE;
  71. // The one and only window has been initialized, so show and update it.
  72. m_pMainWnd->ShowWindow(SW_SHOW);
  73. m_pMainWnd->UpdateWindow();
  74.     AfxGetMainWnd()->SetWindowText("MIB浏览器");//修改窗口标题;
  75. return TRUE;
  76. }
  77. /////////////////////////////////////////////////////////////////////////////
  78. // CAboutDlg dialog used for App About
  79. class CAboutDlg : public CDialog
  80. {
  81. public:
  82. CAboutDlg();
  83. // Dialog Data
  84. //{{AFX_DATA(CAboutDlg)
  85. enum { IDD = IDD_ABOUTBOX };
  86. //}}AFX_DATA
  87. // ClassWizard generated virtual function overrides
  88. //{{AFX_VIRTUAL(CAboutDlg)
  89. protected:
  90. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  91. //}}AFX_VIRTUAL
  92. // Implementation
  93. protected:
  94. //{{AFX_MSG(CAboutDlg)
  95. // No message handlers
  96. //}}AFX_MSG
  97. DECLARE_MESSAGE_MAP()
  98. };
  99. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  100. {
  101. //{{AFX_DATA_INIT(CAboutDlg)
  102. //}}AFX_DATA_INIT
  103. }
  104. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  105. {
  106. CDialog::DoDataExchange(pDX);
  107. //{{AFX_DATA_MAP(CAboutDlg)
  108. //}}AFX_DATA_MAP
  109. }
  110. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  111. //{{AFX_MSG_MAP(CAboutDlg)
  112. // No message handlers
  113. //}}AFX_MSG_MAP
  114. END_MESSAGE_MAP()
  115. // App command to run the dialog
  116. void CMibBrowserApp::OnAppAbout()
  117. {
  118. CAboutDlg aboutDlg;
  119. aboutDlg.DoModal();
  120. }
  121. /////////////////////////////////////////////////////////////////////////////
  122. // CMibBrowserApp message handlers