home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / oleview / doc.cpp next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.3 KB  |  97 lines

  1. // doc.cpp : implementation of the COle2ViewDoc class
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1998 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "OleView.h"
  16.  
  17. #include "doc.h"
  18.  
  19. #ifdef _DEBUG
  20. #undef THIS_FILE
  21. static char BASED_CODE THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // COle2ViewDoc
  26.  
  27. IMPLEMENT_DYNCREATE(COle2ViewDoc, CDocument)
  28.  
  29. BEGIN_MESSAGE_MAP(COle2ViewDoc, CDocument)
  30.     //{{AFX_MSG_MAP(COle2ViewDoc)
  31.         // NOTE - the ClassWizard will add and remove mapping macros here.
  32.         //    DO NOT EDIT what you see in these blocks of generated code !
  33.     //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // COle2ViewDoc construction/destruction
  38.  
  39. COle2ViewDoc::COle2ViewDoc()
  40. {
  41.     m_clsidCur = GUID_NULL ;
  42.     m_szObjectCur = "" ;
  43.     m_fTypeLib = FALSE ;
  44.  
  45.     CString szSection ;
  46.     CString szKey ;
  47.     szSection.LoadString( IDS_INI_CONFIG ) ;
  48.  
  49.     szKey.LoadString( IDS_INI_CLSCTX ) ;
  50.     m_dwClsCtx = (DWORD)theApp.GetProfileInt( szSection, szKey, CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER ) ;
  51.  
  52. }
  53.  
  54. COle2ViewDoc::~COle2ViewDoc()
  55. {
  56.  
  57.     CString szSection ;
  58.     CString szKey ;
  59.     szSection.LoadString( IDS_INI_CONFIG ) ;
  60.  
  61.     szKey.LoadString( IDS_INI_CLSCTX ) ;
  62.     theApp.WriteProfileInt( szSection, szKey, (WORD)m_dwClsCtx ) ;
  63.  
  64. }
  65.  
  66. BOOL COle2ViewDoc::OnNewDocument()
  67. {
  68. //    if (!CDocument::OnNewDocument())
  69. //        return FALSE;
  70.     return TRUE;
  71. }
  72.  
  73. void COle2ViewDoc::OnCloseDocument()
  74. {
  75.     CDocument::OnCloseDocument();
  76. }
  77.  
  78.  
  79. /////////////////////////////////////////////////////////////////////////////
  80. // COle2ViewDoc diagnostics
  81.  
  82. #ifdef _DEBUG
  83. void COle2ViewDoc::AssertValid() const
  84. {
  85.     CDocument::AssertValid();
  86. }
  87.  
  88. void COle2ViewDoc::Dump(CDumpContext& dc) const
  89. {
  90.     CDocument::Dump(dc);
  91. }
  92.  
  93. #endif //_DEBUG
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // COle2ViewDoc commands
  97.