home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / vfDao / MainFrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-10  |  2.6 KB  |  113 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "vfDao.h"
  6.  
  7. #include "MainFrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMainFrame
  17.  
  18. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  19.  
  20. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  21.     //{{AFX_MSG_MAP(CMainFrame)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code !
  24.     ON_WM_CREATE()
  25.     //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. static UINT indicators[] =
  29. {
  30.     ID_SEPARATOR,           // status line indicator
  31.     ID_INDICATOR_CAPS,
  32.     ID_INDICATOR_NUM,
  33.     ID_INDICATOR_SCRL,
  34. };
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CMainFrame construction/destruction
  38.  
  39. CMainFrame::CMainFrame()
  40. {
  41.     // TODO: add member initialization code here
  42.     
  43. }
  44.  
  45. CMainFrame::~CMainFrame()
  46. {
  47. }
  48.  
  49. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  50. {
  51.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  52.         return -1;
  53.  
  54.     /* --- We dont need a toolbar
  55.     if (!m_wndToolBar.Create(this) ||
  56.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  57.     {
  58.         TRACE0("Failed to create toolbar\n");
  59.         return -1;      // fail to create
  60.     }
  61.     */
  62.  
  63.     if (!m_wndStatusBar.Create(this) ||
  64.         !m_wndStatusBar.SetIndicators(indicators,
  65.           sizeof(indicators)/sizeof(UINT)))
  66.     {
  67.         TRACE0("Failed to create status bar\n");
  68.         return -1;      // fail to create
  69.     }
  70.  
  71.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  72.     /*
  73.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  74.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  75.  
  76.     // TODO: Delete these three lines if you don't want the toolbar to
  77.     //  be dockable
  78.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  79.     EnableDocking(CBRS_ALIGN_ANY);
  80.     DockControlBar(&m_wndToolBar);
  81.     */
  82.  
  83.     return 0;
  84. }
  85.  
  86. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  87. {
  88.     // TODO: Modify the Window class or styles here by modifying
  89.     //  the CREATESTRUCT cs
  90.     cs.style &= ~(LONG)FWS_ADDTOTITLE;
  91.  
  92.     return CFrameWnd::PreCreateWindow(cs);
  93. }
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CMainFrame diagnostics
  97.  
  98. #ifdef _DEBUG
  99. void CMainFrame::AssertValid() const
  100. {
  101.     CFrameWnd::AssertValid();
  102. }
  103.  
  104. void CMainFrame::Dump(CDumpContext& dc) const
  105. {
  106.     CFrameWnd::Dump(dc);
  107. }
  108.  
  109. #endif //_DEBUG
  110.  
  111. /////////////////////////////////////////////////////////////////////////////
  112. // CMainFrame message handlers
  113.