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 / iunknown.h < prev    next >
C/C++ Source or Header  |  1996-05-21  |  1KB  |  43 lines

  1. /*
  2.  * IUNKNOWN.H
  3.  *
  4.  * Definitions and function prototypes for a template IUnknown
  5.  * interface implementation that delegates all IUnknown calls
  6.  * to some object controller, ignorant of aggregation.
  7.  *
  8.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Microsoft
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14.  
  15.  
  16. #ifndef _IUNKNOWN_H_
  17. #define _IUNKNOWN_H_
  18.  
  19. #include <inole.h>
  20.  
  21. class CImpIUnknown;
  22. typedef class CImpIUnknown *PCImpIUnknown;
  23.  
  24. class CImpIUnknown : public IUnknown
  25.     {
  26.     protected:
  27.         ULONG           m_cRef;      //Interface reference count
  28.         LPVOID          m_pObj;      //Backpointer to the object
  29.         LPUNKNOWN       m_pUnkOuter; //For delegation
  30.  
  31.     public:
  32.         CImpIUnknown(LPVOID, LPUNKNOWN);
  33.         ~CImpIUnknown(void);
  34.  
  35.         //IUnknown interface members
  36.         STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  37.         STDMETHODIMP_(ULONG) AddRef(void);
  38.         STDMETHODIMP_(ULONG) Release(void);
  39.     };
  40.  
  41.  
  42. #endif //_IUNKNOWN_H_
  43.