home *** CD-ROM | disk | FTP | other *** search
/ Master Visual C++ 1.5 / MASTERVC15.ISO / vcprog / original / ch04 / say / sayview.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-19  |  1.8 KB  |  89 lines

  1. // sayview.cpp : implementation of the CSayView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "say.h"
  6.  
  7. #include "saydoc.h"
  8. #include "sayview.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CSayView
  17.  
  18. IMPLEMENT_DYNCREATE(CSayView, CView)
  19.  
  20. BEGIN_MESSAGE_MAP(CSayView, CView)
  21.     //{{AFX_MSG_MAP(CSayView)
  22.     ON_COMMAND(ID_FILE_SAYHELLO, OnFileSayhello)
  23.     //}}AFX_MSG_MAP
  24. END_MESSAGE_MAP()
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CSayView construction/destruction
  28.  
  29. CSayView::CSayView()
  30. {
  31.     // TODO: add construction code here
  32. }
  33.  
  34. CSayView::~CSayView()
  35. {
  36. }
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CSayView drawing
  40.  
  41. void CSayView::OnDraw(CDC* pDC)
  42. {
  43.     CSayDoc* pDoc = GetDocument();
  44.     ASSERT_VALID(pDoc);
  45.  
  46.     // TODO: add draw code for native data here
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CSayView diagnostics
  51.  
  52. #ifdef _DEBUG
  53. void CSayView::AssertValid() const
  54. {
  55.     CView::AssertValid();
  56. }
  57.  
  58. void CSayView::Dump(CDumpContext& dc) const
  59. {
  60.     CView::Dump(dc);
  61. }
  62.  
  63. CSayDoc* CSayView::GetDocument() // non-debug version is inline
  64. {
  65.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSayDoc)));
  66.     return (CSayDoc*)m_pDocument;
  67. }
  68. #endif //_DEBUG
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CSayView message handlers
  72.  
  73. void CSayView::OnFileSayhello()
  74. {
  75.     // TODO: Add your command handler code here
  76.  
  77.    /////////////////////////
  78.    // MY CODE STARTS HERE //    
  79.    /////////////////////////
  80.  
  81.    MessageBox ("Hello! Have a nice day!");
  82.  
  83.    ///////////////////////
  84.    // MY CODE ENDS HERE //
  85.    ///////////////////////
  86.  
  87.     
  88. }
  89.