home *** CD-ROM | disk | FTP | other *** search
/ Building OCXs / Building_OCXs_Que_1995.iso / code / ch07 / contdoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-15  |  2.5 KB  |  98 lines

  1. // contdoc.cpp : implementation of the CContDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "cont.h"
  6.  
  7. #include "contdoc.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. // CContDoc
  17.  
  18. IMPLEMENT_DYNCREATE(CContDoc, COleDocument)
  19.  
  20. BEGIN_MESSAGE_MAP(CContDoc, COleDocument)
  21.     //{{AFX_MSG_MAP(CContDoc)
  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. // CContDoc construction/destruction
  37.  
  38. CContDoc::CContDoc()
  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.  
  47. CContDoc::~CContDoc()
  48. {
  49. }
  50.  
  51. BOOL CContDoc::OnNewDocument()
  52. {
  53.     if (!COleDocument::OnNewDocument())
  54.         return FALSE;
  55.  
  56.     // TODO: add reinitialization code here
  57.     // (SDI documents will reuse this document)
  58.  
  59.     return TRUE;
  60. }
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CContDoc serialization
  64.  
  65. void CContDoc::Serialize(CArchive& ar)
  66. {
  67.     if (ar.IsStoring())
  68.     {
  69.         // TODO: add storing code here
  70.     }
  71.     else
  72.     {
  73.         // TODO: add loading code here
  74.     }
  75.  
  76.     // Calling the base class COleDocument enables serialization
  77.     //  of the container document's COleClientItem objects.
  78.     COleDocument::Serialize(ar);
  79. }
  80.  
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CContDoc diagnostics
  83.  
  84. #ifdef _DEBUG
  85. void CContDoc::AssertValid() const
  86. {
  87.     COleDocument::AssertValid();
  88. }
  89.  
  90. void CContDoc::Dump(CDumpContext& dc) const
  91. {
  92.     COleDocument::Dump(dc);
  93. }
  94. #endif //_DEBUG
  95.  
  96. /////////////////////////////////////////////////////////////////////////////
  97. // CContDoc commands
  98.