home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / MFC / SAMPLES / MDI / MAINFRM.CP_ / MAINFRM.CP
Encoding:
Text File  |  1993-02-08  |  1.8 KB  |  78 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 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 Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14.  
  15. #include "stdafx.h"
  16. #include "bounce.h"
  17. #include "hello.h"
  18. #include "mdi.h"
  19.  
  20. #include "mainfrm.h"
  21.  
  22. #ifdef _DEBUG
  23. #undef THIS_FILE
  24. static char BASED_CODE THIS_FILE[] = __FILE__;
  25. #endif
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CMainFrame
  29.  
  30. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  31.  
  32. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  33.     //{{AFX_MSG_MAP(CMainFrame)
  34.     ON_COMMAND(IDM_BOUNCE, OnBounce)
  35.     ON_COMMAND(IDM_HELLO, OnHello)
  36.     //}}AFX_MSG_MAP
  37. END_MESSAGE_MAP()
  38.  
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CMainFrame construction/destruction
  42.  
  43. CMainFrame::CMainFrame()
  44. {
  45. }
  46.  
  47. CMainFrame::~CMainFrame()
  48. {
  49. }
  50.  
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CMainFrame commands
  54.  
  55.  
  56. void CMainFrame::OnBounce()
  57. {
  58.     CBounceWnd *pBounceWnd = new CBounceWnd;
  59.     if (!pBounceWnd->Create("Bounce",
  60.         WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, rectDefault, this))
  61.         return;
  62.  
  63.     // the default PostNcDestroy handler will delete this object when destroyed
  64. }
  65.  
  66.  
  67. void CMainFrame::OnHello()
  68. {
  69.     CHelloWnd *pHelloWnd = new CHelloWnd;
  70.     if (!pHelloWnd->Create("Hello",
  71.         WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW,
  72.         rectDefault, this))
  73.         return;
  74.  
  75.     // the default PostNcDestroy handler will delete this object when destroyed
  76. }
  77.  
  78.