Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.8 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // IOCSITE.H - Implements IOleClientSite for the WebOC
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. #include <assert.h>
  12. #include "iocsite.h"
  13. #include "iosite.h"
  14. //**********************************************************************
  15. // COleClientSite::COleClientSite -- Constructor
  16. //**********************************************************************
  17. COleClientSite::COleClientSite(COleSite* pSite)
  18. {
  19. m_pOleSite = pSite;
  20. m_nCount = 0;
  21. AddRef();
  22. }
  23. //**********************************************************************
  24. // COleClientSite::COleClientSite -- Destructor
  25. //**********************************************************************
  26. COleClientSite::~COleClientSite()
  27. {
  28. assert(m_nCount == 0);
  29. }
  30. //**********************************************************************
  31. // COleClientSite::QueryInterface
  32. //**********************************************************************
  33. STDMETHODIMP COleClientSite::QueryInterface(REFIID riid, LPVOID* ppvObj)
  34. {
  35. // delegate to the container Site
  36. return m_pOleSite->QueryInterface(riid, ppvObj);
  37. }
  38. //**********************************************************************
  39. // COleClientSite::AddRef
  40. //**********************************************************************
  41. STDMETHODIMP_(ULONG) COleClientSite::AddRef()
  42. {
  43. return ++m_nCount;
  44. }
  45. //**********************************************************************
  46. // COleClientSite::Release
  47. //**********************************************************************
  48. STDMETHODIMP_(ULONG) COleClientSite::Release()
  49. {
  50. --m_nCount;
  51. if(m_nCount == 0)
  52. {
  53. delete this;
  54. return 0;
  55. }
  56. return m_nCount;
  57. }
  58. //**********************************************************************
  59. // COleClientSite::SaveObject -- Not implemented
  60. //**********************************************************************
  61. STDMETHODIMP COleClientSite::SaveObject()
  62. {
  63. return ResultFromScode(S_OK);
  64. }
  65. //**********************************************************************
  66. // COleClientSite::GetMoniker -- Not implemented
  67. //**********************************************************************
  68. STDMETHODIMP COleClientSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER* ppmk)
  69. {
  70. // need to null the out pointer
  71. *ppmk = NULL;
  72. return ResultFromScode(E_NOTIMPL);
  73. }
  74. //**********************************************************************
  75. // COleClientSite::GetContainer -- Not implemented
  76. //**********************************************************************
  77. STDMETHODIMP COleClientSite::GetContainer(LPOLECONTAINER* ppContainer)
  78. {
  79. // NULL the out pointer
  80. *ppContainer = NULL;
  81. return ResultFromScode(E_NOTIMPL);
  82. }
  83. //**********************************************************************
  84. // COleClientSite::ShowObject -- Not implemented
  85. //**********************************************************************
  86. STDMETHODIMP COleClientSite::ShowObject()
  87. {
  88. return ResultFromScode(S_OK);
  89. }
  90. //**********************************************************************
  91. // COleClientSite::OnShowWindow -- Not implemented
  92. //**********************************************************************
  93. STDMETHODIMP COleClientSite::OnShowWindow(BOOL fShow)
  94. {
  95. return ResultFromScode(S_OK);
  96. }
  97. //**********************************************************************
  98. // COleClientSite::RequestNewObjectLayout -- Not implemented
  99. //**********************************************************************
  100. STDMETHODIMP COleClientSite::RequestNewObjectLayout()
  101. {
  102. return ResultFromScode(E_NOTIMPL);
  103. }