home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / MSGTRACE.ZIP / MyProjects / MsgTrace / MsgTracer / MsgTracerDoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-31  |  2.6 KB  |  104 lines

  1. // MsgTracerDoc.cpp : implementation of the CMsgTracerDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MsgTracer.h"
  6.  
  7. #include "MsgTracerDoc.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. // CMsgTracerDoc
  17.  
  18. IMPLEMENT_DYNCREATE(CMsgTracerDoc, CDocument)
  19.  
  20. BEGIN_MESSAGE_MAP(CMsgTracerDoc, CDocument)
  21.     //{{AFX_MSG_MAP(CMsgTracerDoc)
  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. BEGIN_DISPATCH_MAP(CMsgTracerDoc, CDocument)
  28.     //{{AFX_DISPATCH_MAP(CMsgTracerDoc)
  29.         // NOTE - the ClassWizard will add and remove mapping macros here.
  30.         //      DO NOT EDIT what you see in these blocks of generated code!
  31.     //}}AFX_DISPATCH_MAP
  32. END_DISPATCH_MAP()
  33.  
  34. // Note: we add support for IID_IMsgTracer to support typesafe binding
  35. //  from VBA.  This IID must match the GUID that is attached to the 
  36. //  dispinterface in the .ODL file.
  37.  
  38. // {A5FE8A8C-546E-11D1-BB3E-0040959A2C67}
  39. static const IID IID_IMsgTracer =
  40. { 0xa5fe8a8c, 0x546e, 0x11d1, { 0xbb, 0x3e, 0x0, 0x40, 0x95, 0x9a, 0x2c, 0x67 } };
  41.  
  42. BEGIN_INTERFACE_MAP(CMsgTracerDoc, CDocument)
  43.     INTERFACE_PART(CMsgTracerDoc, IID_IMsgTracer, Dispatch)
  44. END_INTERFACE_MAP()
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CMsgTracerDoc construction/destruction
  48.  
  49. CMsgTracerDoc::CMsgTracerDoc()
  50. {
  51.     // TODO: add one-time construction code here
  52.  
  53.     EnableAutomation();
  54.  
  55.     AfxOleLockApp();
  56. }
  57.  
  58. CMsgTracerDoc::~CMsgTracerDoc()
  59. {
  60.     AfxOleUnlockApp();
  61. }
  62.  
  63. BOOL CMsgTracerDoc::OnNewDocument()
  64. {
  65.     if (!CDocument::OnNewDocument())
  66.         return FALSE;
  67.  
  68.     ((CEditView*)m_viewList.GetHead())->SetWindowText(NULL);
  69.  
  70.     // TODO: add reinitialization code here
  71.     // (SDI documents will reuse this document)
  72.  
  73.     return TRUE;
  74. }
  75.  
  76.  
  77.  
  78. /////////////////////////////////////////////////////////////////////////////
  79. // CMsgTracerDoc serialization
  80.  
  81. void CMsgTracerDoc::Serialize(CArchive& ar)
  82. {
  83.     // CEditView contains an edit control which handles all serialization
  84.     ((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
  85. }
  86.  
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CMsgTracerDoc diagnostics
  89.  
  90. #ifdef _DEBUG
  91. void CMsgTracerDoc::AssertValid() const
  92. {
  93.     CDocument::AssertValid();
  94. }
  95.  
  96. void CMsgTracerDoc::Dump(CDumpContext& dc) const
  97. {
  98.     CDocument::Dump(dc);
  99. }
  100. #endif //_DEBUG
  101.  
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CMsgTracerDoc commands
  104.