Leaked source code of windows server 2003
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.

130 lines
2.4 KiB

  1. /*
  2. * ICLISITE.CPP
  3. * IOleClientSite for Document Objects CSite class
  4. *
  5. * Copyright (c)1995-1999 Microsoft Corporation, All Rights Reserved
  6. */
  7. #include "stdafx.h"
  8. #include <docobj.h>
  9. #include "site.h"
  10. /**
  11. Note: the m_cRef count is provided for debugging purposes only.
  12. CSite controls the destruction of the object through delete,
  13. not reference counting
  14. */
  15. /*
  16. * CImpIOleClientSite::CImpIOleClientSite
  17. * CImpIOleClientSite::~CImpIOleClientSite
  18. *
  19. * Parameters (Constructor):
  20. * pSite PCSite of the site we're in.
  21. * pUnkOuter LPUNKNOWN to which we delegate.
  22. */
  23. CImpIOleClientSite::CImpIOleClientSite( PCSite pSite, LPUNKNOWN pUnkOuter )
  24. {
  25. m_cRef = 0;
  26. m_pSite = pSite;
  27. m_pUnkOuter = pUnkOuter;
  28. }
  29. CImpIOleClientSite::~CImpIOleClientSite( void )
  30. {
  31. }
  32. /*
  33. * CImpIOleClientSite::QueryInterface
  34. * CImpIOleClientSite::AddRef
  35. * CImpIOleClientSite::Release
  36. *
  37. * Purpose:
  38. * IUnknown members for CImpIOleClientSite object.
  39. */
  40. STDMETHODIMP CImpIOleClientSite::QueryInterface( REFIID riid, void **ppv )
  41. {
  42. return m_pUnkOuter->QueryInterface( riid, ppv );
  43. }
  44. STDMETHODIMP_(ULONG) CImpIOleClientSite::AddRef( void )
  45. {
  46. ++m_cRef;
  47. return m_pUnkOuter->AddRef();
  48. }
  49. STDMETHODIMP_(ULONG) CImpIOleClientSite::Release( void )
  50. {
  51. --m_cRef;
  52. return m_pUnkOuter->Release();
  53. }
  54. /*
  55. * CImpIOleClientSite::SaveObject
  56. *
  57. * Purpose:
  58. * Requests that the container call OleSave for the object that
  59. * lives here. Typically this happens on server shutdown.
  60. *
  61. * Parameters:
  62. * None
  63. *
  64. * Return Value:
  65. * HRESULT Standard.
  66. */
  67. STDMETHODIMP CImpIOleClientSite::SaveObject( void )
  68. {
  69. return S_OK;
  70. }
  71. /*
  72. * Unimplemented/trivial members
  73. * GetMoniker
  74. * GetContainer
  75. * RequestNewObjectLayout
  76. * OnShowWindow
  77. * ShowObject
  78. */
  79. STDMETHODIMP CImpIOleClientSite::GetMoniker(DWORD /*dwAssign*/,
  80. DWORD /*dwWhich*/, LPMONIKER* /*ppmk*/)
  81. {
  82. return E_NOTIMPL;
  83. }
  84. STDMETHODIMP CImpIOleClientSite::GetContainer( LPOLECONTAINER* ppContainer )
  85. {
  86. _ASSERTE ( m_pSite );
  87. if ( m_pSite )
  88. {
  89. return m_pSite->GetContainer ( ppContainer );
  90. }
  91. return E_NOTIMPL;
  92. }
  93. STDMETHODIMP CImpIOleClientSite::RequestNewObjectLayout(void)
  94. {
  95. return E_NOTIMPL;
  96. }
  97. STDMETHODIMP CImpIOleClientSite::OnShowWindow(BOOL /*fShow*/)
  98. {
  99. return S_OK;
  100. }
  101. STDMETHODIMP CImpIOleClientSite::ShowObject(void)
  102. {
  103. return S_OK;
  104. }