home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 32 / IOPROG_32.ISO / SOFT / SqlEval7 / devtools / samples / ODBC / mfcperf / mainfrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-20  |  2.4 KB  |  97 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This file is part of Microsoft SQL Server online documentation.
  4. // Copyright (C) 1992-1997 Microsoft Corporation. All rights reserved.
  5. //
  6. // This source code is an intended supplement to the Microsoft SQL
  7. // Server online references and related electronic documentation.
  8. #include "stdafx.h"
  9. #include "MFCPerf.h"
  10.  
  11. #include "MainFrm.h"
  12.  
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18.  
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CMainFrame
  21. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  22.  
  23. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  24.     //{{AFX_MSG_MAP(CMainFrame)
  25.     ON_WM_CREATE()
  26.     //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28.  
  29. static UINT indicators[] =
  30.     {
  31.     ID_SEPARATOR,           // status line indicator
  32.     ID_INDICATOR_CAPS,
  33.     ID_INDICATOR_NUM,
  34.     ID_INDICATOR_SCRL,
  35.     };
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CMainFrame construction/destruction
  39. CMainFrame::CMainFrame()
  40.     {
  41.     }
  42.  
  43. CMainFrame::~CMainFrame()
  44.     {
  45.     }
  46.  
  47. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  48.     {
  49.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  50.         return -1;
  51.     
  52.     if (!m_wndToolBar.Create(this) ||
  53.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  54.     {
  55.         TRACE0("Failed to create toolbar\n");
  56.         return -1;      // fail to create
  57.     }
  58.  
  59.     if (!m_wndStatusBar.Create(this) ||
  60.         !m_wndStatusBar.SetIndicators(indicators,
  61.           sizeof(indicators)/sizeof(UINT)))
  62.     {
  63.         TRACE0("Failed to create status bar\n");
  64.         return -1;      // fail to create
  65.     }
  66.  
  67.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  68.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  69.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  70.  
  71.     // TODO: Delete these three lines if you don't want the toolbar to
  72.     //  be dockable
  73.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  74.     EnableDocking(CBRS_ALIGN_ANY);
  75.     DockControlBar(&m_wndToolBar);
  76.  
  77.     return 0;
  78.     }
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81. // CMainFrame diagnostics
  82. #ifdef _DEBUG
  83. void CMainFrame::AssertValid() const
  84.     {
  85.     CMDIFrameWnd::AssertValid();
  86.     }
  87.  
  88. void CMainFrame::Dump(CDumpContext& dc) const
  89.     {
  90.     CMDIFrameWnd::Dump(dc);
  91.     }
  92.  
  93. #endif //_DEBUG
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CMainFrame message handlers
  97.