ctlcache.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #include "stdafx.h"
  11. #ifdef AFXCTL_CORE3_SEG
  12. #pragma code_seg(AFXCTL_CORE3_SEG)
  13. #endif
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. #define new DEBUG_NEW
  19. /////////////////////////////////////////////////////////////////////////////
  20. // COleControl::XOleCache
  21. STDMETHODIMP_(ULONG) COleControl::XOleCache::AddRef()
  22. {
  23. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  24. return (ULONG)pThis->ExternalAddRef();
  25. }
  26. STDMETHODIMP_(ULONG) COleControl::XOleCache::Release()
  27. {
  28. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  29. return (ULONG)pThis->ExternalRelease();
  30. }
  31. STDMETHODIMP COleControl::XOleCache::QueryInterface(
  32. REFIID iid, LPVOID* ppvObj)
  33. {
  34. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  35. return (HRESULT)pThis->ExternalQueryInterface(&iid, ppvObj);
  36. }
  37. STDMETHODIMP COleControl::XOleCache::Cache(LPFORMATETC lpFormatetc, DWORD advf,
  38. LPDWORD lpdwConnection)
  39. {
  40. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  41. if (pThis->m_pDefIOleCache == NULL)
  42. pThis->m_pDefIOleCache =
  43. (LPOLECACHE)pThis->QueryDefHandler(IID_IOleCache);
  44. return pThis->m_pDefIOleCache->Cache(lpFormatetc, advf, lpdwConnection);
  45. }
  46. STDMETHODIMP COleControl::XOleCache::Uncache(DWORD dwConnection)
  47. {
  48. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  49. if (pThis->m_pDefIOleCache == NULL)
  50. pThis->m_pDefIOleCache =
  51. (LPOLECACHE)pThis->QueryDefHandler(IID_IOleCache);
  52. return pThis->m_pDefIOleCache->Uncache(dwConnection);
  53. }
  54. STDMETHODIMP COleControl::XOleCache::EnumCache(
  55. LPENUMSTATDATA* ppenumStatData)
  56. {
  57. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  58. if (pThis->m_pDefIOleCache == NULL)
  59. pThis->m_pDefIOleCache =
  60. (LPOLECACHE)pThis->QueryDefHandler(IID_IOleCache);
  61. return pThis->m_pDefIOleCache->EnumCache(ppenumStatData);
  62. }
  63. STDMETHODIMP COleControl::XOleCache::InitCache(LPDATAOBJECT pDataObject)
  64. {
  65. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  66. if (pThis->m_pDefIOleCache == NULL)
  67. pThis->m_pDefIOleCache =
  68. (LPOLECACHE)pThis->QueryDefHandler(IID_IOleCache);
  69. return pThis->m_pDefIOleCache->InitCache(pDataObject);
  70. }
  71. STDMETHODIMP COleControl::XOleCache::SetData(LPFORMATETC pformatetc,
  72. STGMEDIUM* pmedium, BOOL fRelease)
  73. {
  74. METHOD_PROLOGUE_EX_(COleControl, OleCache)
  75. if (pThis->m_pDefIOleCache == NULL)
  76. pThis->m_pDefIOleCache =
  77. (LPOLECACHE)pThis->QueryDefHandler(IID_IOleCache);
  78. return pThis->m_pDefIOleCache->SetData(pformatetc, pmedium, fRelease);
  79. }
  80. /////////////////////////////////////////////////////////////////////////////
  81. // Force any extra compiler-generated code into AFX_INIT_SEG
  82. #ifdef AFX_INIT_SEG
  83. #pragma code_seg(AFX_INIT_SEG)
  84. #endif