home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c06 / modal / modaldoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.6 KB  |  80 lines

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