home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / MDIMFC.PAK / MDI.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.1 KB  |  86 lines

  1. // mdi.cpp : Defines the class behaviors for the application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "mdi.h"
  15.  
  16. #include "mainfrm.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CMdiApp
  25.  
  26. BEGIN_MESSAGE_MAP(CMdiApp, CWinApp)
  27.     //{{AFX_MSG_MAP(CMdiApp)
  28.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  29.     //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CMdiApp construction
  34. // Place all significant initialization in InitInstance
  35.  
  36. CMdiApp::CMdiApp()
  37. {
  38. }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // The one and only CMdiApp object
  42.  
  43. CMdiApp NEAR theApp;
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CMdiApp initialization
  47.  
  48. BOOL CMdiApp::InitInstance()
  49. {
  50.     Enable3dControls();
  51.  
  52.     // create main MDI Frame window
  53.     CMainFrame* pMainFrame = new CMainFrame;
  54.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  55.         return FALSE;
  56.     pMainFrame->ShowWindow(m_nCmdShow);
  57.     pMainFrame->UpdateWindow();
  58.     m_pMainWnd = pMainFrame;
  59.  
  60.     // load the two static menus
  61.     return TRUE;
  62. }
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CMdiApp commands
  66.  
  67. void CMdiApp::OnAppAbout()
  68. {
  69.     CDialog(IDD_ABOUTBOX).DoModal();
  70. }
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73. // other globals
  74.  
  75. // Color array maps to Color menu
  76. COLORREF NEAR colorArray[] =
  77. {
  78.     RGB (0, 0, 0),
  79.     RGB (255, 0, 0),
  80.     RGB (0, 255, 0),
  81.     RGB (0, 0, 255),
  82.     RGB (255, 255, 255)
  83. };
  84.  
  85. /////////////////////////////////////////////////////////////////////////////
  86.