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 / iextconn.cpp < prev    next >
C/C++ Source or Header  |  1995-05-03  |  3KB  |  126 lines

  1. /*
  2.  * IEXTCONN.CPP
  3.  *
  4.  * Template IExternalConnection interface implementation.
  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 "iextconn.h"
  15.  
  16.  
  17. /*
  18.  * CImpIExternalConnection::CImpIExternalConnection
  19.  * CImpIExternalConnection::~CImpIExternalConnection
  20.  *
  21.  * Parameters (Constructor):
  22.  *  pObj            LPVOID of the object we're in.
  23.  *  pUnkOuter       LPUNKNOWN to which we delegate.
  24.  */
  25.  
  26. CImpIExternalConnection::CImpIExternalConnection(LPVOID pObj
  27.     , LPUNKNOWN pUnkOuter)
  28.     {
  29.     m_cRef=0;
  30.     m_pObj=pObj;
  31.     m_pUnkOuter=pUnkOuter;
  32.     return;
  33.     }
  34.  
  35. CImpIExternalConnection::~CImpIExternalConnection(void)
  36.     {
  37.     return;
  38.     }
  39.  
  40.  
  41.  
  42. /*
  43.  * CImpIExternalConnection::QueryInterface
  44.  * CImpIExternalConnection::AddRef
  45.  * CImpIExternalConnection::Release
  46.  *
  47.  * Purpose:
  48.  *  Delegating IUnknown members for CImpIExternalConnection.
  49.  */
  50.  
  51. STDMETHODIMP CImpIExternalConnection::QueryInterface(REFIID riid
  52.     , LPVOID *ppv)
  53.     {
  54.     return m_pUnkOuter->QueryInterface(riid, ppv);
  55.     }
  56.  
  57. STDMETHODIMP_(ULONG) CImpIExternalConnection::AddRef(void)
  58.     {
  59.     ++m_cRef;
  60.     return m_pUnkOuter->AddRef();
  61.     }
  62.  
  63. STDMETHODIMP_(ULONG) CImpIExternalConnection::Release(void)
  64.     {
  65.     --m_cRef;
  66.     return m_pUnkOuter->Release();
  67.     }
  68.  
  69.  
  70.  
  71.  
  72. /*
  73.  * CImpIExternalConnection::AddConnection
  74.  *
  75.  * Purpose:
  76.  *  Informs the object that a strong connection has been made to it.
  77.  *
  78.  * Parameters:
  79.  *  dwConn          DWORD identifying the type of connection, taken
  80.  *                  from the EXTCONN enumeration.
  81.  *  dwReserved      DWORD reserved.  This is used inside OLE and
  82.  *                  should not be validated.
  83.  *
  84.  * Return Value:
  85.  *  DWORD           The number of connection counts on the
  86.  *                  object, used for debugging purposes only.
  87.  */
  88.  
  89. STDMETHODIMP_(DWORD) CImpIExternalConnection::AddConnection
  90.     (DWORD dwConn, DWORD dwReserved)
  91.     {
  92.     return 0L;
  93.     }
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. /*
  101.  * CImpIExternalConnection::ReleaseConnection
  102.  *
  103.  * Purpose:
  104.  *  Informs an object that a connection has been taken away from
  105.  *  it in which case the object may need to shut down.
  106.  *
  107.  * Parameters:
  108.  *  dwConn              DWORD identifying the type of connection,
  109.  *                      taken from the EXTCONN enumeration.
  110.  *  dwReserved          DWORD reserved.  This is used inside OLE and
  111.  *                      should not be validated.
  112.  *  dwRerved            DWORD reserved
  113.  *  fLastReleaseCloses  BOOL indicating if the last call to this
  114.  *                      function should close the object.
  115.  *
  116.  * Return Value:
  117.  *  DWORD           The number of remaining connection counts on
  118.  *                  the object, used for debugging purposes only.
  119.  */
  120.  
  121. STDMETHODIMP_(DWORD) CImpIExternalConnection::ReleaseConnection
  122.     (DWORD dwConn, DWORD dwReserved, BOOL fLastReleaseCloses)
  123.     {
  124.     return 0L;
  125.     }
  126.