home *** CD-ROM | disk | FTP | other *** search
/ Master Visual C++ 1.5 / MASTERVC15.ISO / vcprog / original / ch28 / announce / annouvw.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-11  |  2.1 KB  |  93 lines

  1. // annouvw.cpp : implementation of the CAnnounceView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "announce.h"
  6.  
  7. #include "annoudoc.h"
  8. #include "annouvw.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CAnnounceView
  17.  
  18. IMPLEMENT_DYNCREATE(CAnnounceView, CView)
  19.  
  20. BEGIN_MESSAGE_MAP(CAnnounceView, CView)
  21.     //{{AFX_MSG_MAP(CAnnounceView)
  22.     ON_WM_PAINT()
  23.     //}}AFX_MSG_MAP
  24. END_MESSAGE_MAP()
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CAnnounceView construction/destruction
  28.  
  29. CAnnounceView::CAnnounceView()
  30. {
  31.     // TODO: add construction code here
  32. }
  33.  
  34. CAnnounceView::~CAnnounceView()
  35. {
  36. }
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CAnnounceView drawing
  40.  
  41. void CAnnounceView::OnDraw(CDC* pDC)
  42. {
  43.     CAnnounceDoc* pDoc = GetDocument();
  44.     ASSERT_VALID(pDoc);
  45.  
  46.     // TODO: add draw code for native data here
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CAnnounceView diagnostics
  51.  
  52. #ifdef _DEBUG
  53. void CAnnounceView::AssertValid() const
  54. {
  55.     CView::AssertValid();
  56. }
  57.  
  58. void CAnnounceView::Dump(CDumpContext& dc) const
  59. {
  60.     CView::Dump(dc);
  61. }
  62.  
  63. CAnnounceDoc* CAnnounceView::GetDocument() // non-debug version is inline
  64. {
  65.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAnnounceDoc)));
  66.     return (CAnnounceDoc*)m_pDocument;
  67. }
  68. #endif //_DEBUG
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CAnnounceView message handlers
  72.  
  73. void CAnnounceView::OnPaint()
  74. {
  75.     CPaintDC dc(this); // device context for painting
  76.     
  77.     // TODO: Add your message handler code here
  78.  
  79.     ///////////////////////
  80.     // MY CODE STARTS HERE
  81.     //////////////////////
  82.  
  83.     // Display instructions inside the application window.
  84.     dc.TextOut(20,30,"Leave this program running...");
  85.     dc.TextOut(20,50,"Then try to exit Windows...");
  86.  
  87.     ////////////////////
  88.     // MY CODE ENDS HERE
  89.     ////////////////////
  90.  
  91.     // Do not call CView::OnPaint() for painting messages
  92. }
  93.