MainFrm.cpp
上传用户:z_mail1980
上传日期:2007-06-01
资源大小:647k
文件大小:2k
源码类别:

SNMP编程

开发平台:

Visual C++

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "Tasking.h"
  5. #include "MainFrm.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CMainFrame
  13. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  14. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  15. //{{AFX_MSG_MAP(CMainFrame)
  16. // NOTE - the ClassWizard will add and remove mapping macros here.
  17. //    DO NOT EDIT what you see in these blocks of generated code !
  18. ON_WM_CREATE()
  19. //}}AFX_MSG_MAP
  20. END_MESSAGE_MAP()
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CMainFrame construction/destruction
  23. CMainFrame::CMainFrame()
  24. {
  25. // TODO: add member initialization code here
  26. }
  27. CMainFrame::~CMainFrame()
  28. {
  29. }
  30. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  31. {
  32. if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  33. return -1;
  34. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  35. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  36. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  37. {
  38. TRACE0("Failed to create toolbarn");
  39. return -1;      // fail to create
  40. }
  41. // TODO: Delete these three lines if you don't want the toolbar to
  42. //  be dockable
  43. m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  44. EnableDocking(CBRS_ALIGN_ANY);
  45. DockControlBar(&m_wndToolBar);
  46. return 0;
  47. }
  48. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  49. {
  50. if( !CFrameWnd::PreCreateWindow(cs) )
  51. return FALSE;
  52. // TODO: Modify the Window class or styles here by modifying
  53. //  the CREATESTRUCT cs
  54. return TRUE;
  55. }
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CMainFrame diagnostics
  58. #ifdef _DEBUG
  59. void CMainFrame::AssertValid() const
  60. {
  61. CFrameWnd::AssertValid();
  62. }
  63. void CMainFrame::Dump(CDumpContext& dc) const
  64. {
  65. CFrameWnd::Dump(dc);
  66. }
  67. #endif //_DEBUG
  68. /////////////////////////////////////////////////////////////////////////////
  69. // CMainFrame message handlers