home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / WTJ9403.ZIP / CONTAIN / CONTADOC.CPP < prev    next >
C/C++ Source or Header  |  1994-01-06  |  3KB  |  97 lines

  1. // contadoc.cpp : implementation of the CContainDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "contain.h"
  6.  
  7. #include "contadoc.h"
  8. #include "cntritem.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CContainDoc
  17.  
  18. IMPLEMENT_DYNCREATE(CContainDoc, COleDocument)
  19.  
  20. BEGIN_MESSAGE_MAP(CContainDoc, COleDocument)
  21.     //{{AFX_MSG_MAP(CContainDoc)
  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.     // Enable default OLE container implementation
  26.     ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, COleDocument::OnUpdatePasteMenu)
  27.     ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE_LINK, COleDocument::OnUpdatePasteLinkMenu)
  28.     ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_LINKS, COleDocument::OnUpdateEditLinksMenu)
  29.     ON_COMMAND(ID_OLE_EDIT_LINKS, COleDocument::OnEditLinks)
  30.     ON_UPDATE_COMMAND_UI(ID_OLE_VERB_FIRST, COleDocument::OnUpdateObjectVerbMenu)
  31.     ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_CONVERT, COleDocument::OnUpdateObjectVerbMenu)
  32.     ON_COMMAND(ID_OLE_EDIT_CONVERT, COleDocument::OnEditConvert)
  33. END_MESSAGE_MAP()
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CContainDoc construction/destruction
  37.  
  38. CContainDoc::CContainDoc()
  39. {
  40.     // For most containers, using compound files is a good idea.
  41.     EnableCompoundFile();
  42.  
  43.     // TODO: add one-time construction code here
  44. }
  45.  
  46. CContainDoc::~CContainDoc()
  47. {
  48. }
  49.  
  50. BOOL CContainDoc::OnNewDocument()
  51. {
  52.     if (!COleDocument::OnNewDocument())
  53.         return FALSE;
  54.  
  55.     // TODO: add reinitialization code here
  56.     // (SDI documents will reuse this document)
  57.  
  58.     return TRUE;
  59. }
  60.  
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CContainDoc serialization
  63.  
  64. void CContainDoc::Serialize(CArchive& ar)
  65. {
  66.     if (ar.IsStoring())
  67.     {
  68.         // TODO: add storing code here
  69.     }
  70.     else
  71.     {
  72.         // TODO: add loading code here
  73.     }
  74.  
  75.     // Calling the base class COleDocument enables serialization
  76.     //  of the container document's COleClientItem objects.
  77.     COleDocument::Serialize(ar);
  78. }
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81. // CContainDoc diagnostics
  82.  
  83. #ifdef _DEBUG
  84. void CContainDoc::AssertValid() const
  85. {
  86.     COleDocument::AssertValid();
  87. }
  88.  
  89. void CContainDoc::Dump(CDumpContext& dc) const
  90. {
  91.     COleDocument::Dump(dc);
  92. }
  93. #endif //_DEBUG
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CContainDoc commands
  97.