home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c07 / scroll / scroldoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.7 KB  |  84 lines

  1. // ScrolDoc.cpp : implementation of the CScrollDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Scroll.h"
  6.  
  7. #include "ScrolDoc.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. // CScrollDoc
  17.  
  18. IMPLEMENT_DYNCREATE(CScrollDoc, CDocument)
  19.  
  20. BEGIN_MESSAGE_MAP(CScrollDoc, CDocument)
  21.     //{{AFX_MSG_MAP(CScrollDoc)
  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.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CScrollDoc construction/destruction
  29.  
  30. CScrollDoc::CScrollDoc()
  31. {
  32.     m_phrase.LoadString(IDS_WELCOME_MSG);
  33.     m_pt.x = 0;
  34.     m_pt.y = 0;
  35. }
  36.  
  37. CScrollDoc::~CScrollDoc()
  38. {
  39. }
  40.  
  41. BOOL CScrollDoc::OnNewDocument()
  42. {
  43.     if (!CDocument::OnNewDocument())
  44.         return FALSE;
  45.  
  46.     // TODO: add reinitialization code here
  47.     // (SDI documents will reuse this document)
  48.  
  49.     return TRUE;
  50. }
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CScrollDoc serialization
  54.  
  55. void CScrollDoc::Serialize(CArchive& ar)
  56. {
  57.     if (ar.IsStoring())
  58.     {
  59.         // TODO: add storing code here
  60.     }
  61.     else
  62.     {
  63.         // TODO: add loading code here
  64.     }
  65. }
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // CScrollDoc diagnostics
  69.  
  70. #ifdef _DEBUG
  71. void CScrollDoc::AssertValid() const
  72. {
  73.     CDocument::AssertValid();
  74. }
  75.  
  76. void CScrollDoc::Dump(CDumpContext& dc) const
  77. {
  78.     CDocument::Dump(dc);
  79. }
  80. #endif //_DEBUG
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CScrollDoc commands
  84.