OIPAOBJ.CPP
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:6k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /**************************************************************************
  2.    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3.    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4.    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5.    PARTICULAR PURPOSE.
  6.    Copyright 1997 Microsoft Corporation.  All Rights Reserved.
  7. **************************************************************************/
  8. /**************************************************************************
  9.    File:          OIPAObj.cpp
  10.    
  11.    Description:   COleInPlaceActiveObject implementation.
  12. **************************************************************************/
  13. /**************************************************************************
  14.    #include statements
  15. **************************************************************************/
  16. #include "OIPAObj.h"
  17. /**************************************************************************
  18.    COleInPlaceActiveObject::COleInPlaceActiveObject()
  19.    
  20. **************************************************************************/
  21. COleInPlaceActiveObject::COleInPlaceActiveObject(COleDocument *pOleDoc)
  22. {
  23. OutputDebugString(TEXT("COleInPlaceActiveObject's constructorn"));
  24. m_pOleDoc = pOleDoc;
  25. m_fEnableModeless = FALSE;
  26. }
  27. /**************************************************************************
  28.    COleInPlaceActiveObject::~COleInPlaceActiveObject()
  29.    
  30. **************************************************************************/
  31. COleInPlaceActiveObject::~COleInPlaceActiveObject()
  32. {
  33. OutputDebugString(TEXT("COleInPlaceActiveObject's destructorn"));
  34. }
  35. /**************************************************************************
  36.    COleInPlaceActiveObject::QueryInterface()
  37.    
  38. **************************************************************************/
  39. STDMETHODIMP COleInPlaceActiveObject::QueryInterface(REFIID riid, LPVOID *ppReturn)
  40. {
  41. OutputDebugString(TEXT("COleInPlaceActiveObject::QueryInterfacen"));
  42. return m_pOleDoc->QueryInterface(riid, ppReturn);
  43. }
  44. /**************************************************************************
  45.    COleInPlaceActiveObject::AddRef()
  46.    
  47. **************************************************************************/
  48. STDMETHODIMP_(ULONG) COleInPlaceActiveObject::AddRef()
  49. {
  50. OutputDebugString(TEXT("COleInPlaceActiveObject::AddRefn"));
  51. return m_pOleDoc->AddRef();
  52. }
  53. /**************************************************************************
  54.    COleInPlaceActiveObject::Release()
  55.    
  56. **************************************************************************/
  57. STDMETHODIMP_(ULONG) COleInPlaceActiveObject::Release()
  58. {
  59. OutputDebugString(TEXT("COleInPlaceActiveObject::Releasen"));
  60. return m_pOleDoc->Release();
  61. }
  62. /**************************************************************************
  63.    COleInPlaceActiveObject::OnDocWindowActivate()
  64.    
  65. **************************************************************************/
  66. STDMETHODIMP COleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)
  67. {
  68. OutputDebugString(TEXT("COleInPlaceActiveObject::OnDocWindowActivaten"));
  69. //If we are getting activated, merge our menus.
  70. if(fActivate)
  71.    {
  72.    if(m_pOleDoc->m_pOleDocView)
  73.       {
  74.       m_pOleDoc->m_pOleDocView->MergeMenus();
  75.       }
  76.    }
  77. return S_OK;
  78. }
  79. /**************************************************************************
  80.    COleInPlaceActiveObject::OnFrameWindowActivate()
  81.    
  82. **************************************************************************/
  83. STDMETHODIMP COleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)
  84. {
  85. OutputDebugString(TEXT("COleInPlaceActiveObject::OnFrameWindowActivaten"));
  86. return S_OK;
  87. }
  88. /**************************************************************************
  89.    COleInPlaceActiveObject::GetWindow()
  90.    
  91. **************************************************************************/
  92. STDMETHODIMP COleInPlaceActiveObject::GetWindow(HWND *phwnd)
  93. {
  94. OutputDebugString(TEXT("COleInPlaceActiveObject::GetWindown"));
  95. return m_pOleDoc->GetWindow(phwnd);
  96. }
  97. /**************************************************************************
  98.    COleInPlaceActiveObject::ContextSensitiveHelp()
  99.    
  100. **************************************************************************/
  101. STDMETHODIMP COleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode)
  102. {
  103. OutputDebugString(TEXT("COleInPlaceActiveObject::ContextSensitiveHelpn"));
  104. return E_NOTIMPL;
  105. }
  106. /**************************************************************************
  107.    COleInPlaceActiveObject::TranslateAccelerator()
  108.    
  109. **************************************************************************/
  110. STDMETHODIMP COleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)
  111. {
  112. OutputDebugString(TEXT("COleInPlaceActiveObject::TranslateAcceleratorn"));
  113. // no accelerator table, return FALSE
  114. return S_FALSE;
  115. }
  116. /**************************************************************************
  117.    COleInPlaceActiveObject::ResizeBorder()
  118.    
  119. **************************************************************************/
  120. STDMETHODIMP COleInPlaceActiveObject::ResizeBorder(   LPCRECT lprectBorder,
  121.                                                       LPOLEINPLACEUIWINDOW lpUIWindow,
  122.                                                       BOOL fFrameWindow)
  123. {
  124. OutputDebugString(TEXT("COleInPlaceActiveObject::ResizeBordern"));
  125. return S_OK;
  126. }
  127. /**************************************************************************
  128.    COleInPlaceActiveObject::EnableModeless()
  129.    
  130. **************************************************************************/
  131. STDMETHODIMP COleInPlaceActiveObject::EnableModeless(BOOL fEnable)
  132. {
  133. OutputDebugString(TEXT("COleInPlaceActiveObject::EnableModelessn"));
  134. m_fEnableModeless = fEnable;
  135. return S_OK;
  136. }