home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / interfac / iconnptc.cpp < prev    next >
C/C++ Source or Header  |  1996-05-21  |  3KB  |  113 lines

  1. /*
  2.  * ICONNPTC.CPP
  3.  *
  4.  * Template implemenation of IConnectionPointContainer.
  5.  *
  6.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  7.  *
  8.  * Kraig Brockschmidt, Microsoft
  9.  * Internet  :  kraigb@microsoft.com
  10.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  11.  */
  12.  
  13.  
  14. #include "iconnptc.h"
  15.  
  16.  
  17. /*
  18.  * CImpIConnectionPointContainer::CImpIConnectionPointContainer
  19.  * CImpIConnectionPointContainer::~CImpIConnectionPointContainer
  20.  *
  21.  * Parameters (Constructor):
  22.  *  pObj            LPVOID of the object we're in.
  23.  *  pUnkOuter       LPUNKNOWN to which we delegate.
  24.  */
  25.  
  26. CImpIConnectionPointContainer::CImpIConnectionPointContainer
  27.     (LPVOID pObj, LPUNKNOWN pUnkOuter)
  28.     {
  29.     m_cRef=0;
  30.     m_pObj=pObj;
  31.     m_pUnkOuter=pUnkOuter;
  32.     return;
  33.     }
  34.  
  35. CImpIConnectionPointContainer::~CImpIConnectionPointContainer(void)
  36.     {
  37.     return;
  38.     }
  39.  
  40.  
  41.  
  42. /*
  43.  * CImpIConnectionPointContainer::QueryInterface
  44.  * CImpIConnectionPointContainer::AddRef
  45.  * CImpIConnectionPointContainer::Release
  46.  *
  47.  * Purpose:
  48.  *  Delegating IUnknown members for CImpIConnectionPointContainer.
  49.  */
  50.  
  51. STDMETHODIMP CImpIConnectionPointContainer::QueryInterface(REFIID riid
  52.     , LPVOID *ppv)
  53.     {
  54.     return m_pUnkOuter->QueryInterface(riid, ppv);
  55.     }
  56.  
  57. STDMETHODIMP_(ULONG) CImpIConnectionPointContainer::AddRef(void)
  58.     {
  59.     ++m_cRef;
  60.     return m_pUnkOuter->AddRef();
  61.     }
  62.  
  63. STDMETHODIMP_(ULONG) CImpIConnectionPointContainer::Release(void)
  64.     {
  65.     --m_cRef;
  66.     return m_pUnkOuter->Release();
  67.     }
  68.  
  69.  
  70.  
  71. /*
  72.  * CImpIConnectionPointContainer::EnumConnectionPoints
  73.  *
  74.  * Purpose:
  75.  *  Creates and returns an enumerator object with the
  76.  *  IEnumConnectionPoints interface that will enumerate the
  77.  *  individual connection points supported in this object.
  78.  *
  79.  * Parameters:
  80.  *  ppEnum          LPENUMCONNECTIONPOINTS in which to store the
  81.  *                  IEnumConnectionPoints pointer.
  82.  */
  83.  
  84. STDMETHODIMP CImpIConnectionPointContainer::EnumConnectionPoints
  85.     (LPENUMCONNECTIONPOINTS *ppEnum)
  86.     {
  87.     *ppEnum=NULL;
  88.     return ResultFromScode(E_NOTIMPL);
  89.     }
  90.  
  91.  
  92.  
  93. /*
  94.  * CImpIConnectionPointContainer::FindConnectionPoint
  95.  *
  96.  * Purpose:
  97.  *  Returns a pointer to the IConnectionPoint for a given
  98.  *  outgoing IID.
  99.  *
  100.  * Parameters:
  101.  *  riid            REFIID of the outgoing interface for which
  102.  *                  a connection point is desired.
  103.  *  ppCP            IConnectionPoint ** in which to return
  104.  *                  the pointer after calling AddRef.
  105.  */
  106.  
  107. STDMETHODIMP CImpIConnectionPointContainer::FindConnectionPoint
  108.     (REFIID riid, IConnectionPoint **ppCP)
  109.     {
  110.     *ppCP=NULL;
  111.     return ResultFromScode(E_NOTIMPL);
  112.     }
  113.