home *** CD-ROM | disk | FTP | other *** search
- // memodoc.cpp : implementation of the CMemoDoc class
- //
-
- #include "stdafx.h"
- #include "memo.h"
-
- #include "memodoc.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMemoDoc
-
- IMPLEMENT_DYNCREATE(CMemoDoc, CDocument)
-
- BEGIN_MESSAGE_MAP(CMemoDoc, CDocument)
- //{{AFX_MSG_MAP(CMemoDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMemoDoc construction/destruction
-
- CMemoDoc::CMemoDoc()
- {
- // TODO: add one-time construction code here
- }
-
- CMemoDoc::~CMemoDoc()
- {
- }
-
- BOOL CMemoDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
-
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
-
- ///////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Make the memo blank.
- m_Date = "";
- m_Ref = "";
- m_From = "";
- m_To = "";
- m_Memo = "";
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
-
- return TRUE;
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMemoDoc serialization
-
- void CMemoDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Write to the file.
- ar << m_Date;
- ar << m_Ref;
- ar << m_From;
- ar << m_To;
- ar << m_Memo;
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
- else
- {
- // TODO: add loading code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Read from the file.
- ar >> m_Date;
- ar >> m_Ref;
- ar >> m_From;
- ar >> m_To;
- ar >> m_Memo;
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMemoDoc diagnostics
-
- #ifdef _DEBUG
- void CMemoDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
-
- void CMemoDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMemoDoc commands
-