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 / chap05 / ekoala1 / koala.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  1KB  |  47 lines

  1. /*
  2.  * KOALA.H
  3.  * Koala Object Independent of DLL/EXE Servers, Chapter 5
  4.  *
  5.  * Classes that implement the Koala object independent of
  6.  * whether we live in a DLL or EXE.
  7.  *
  8.  * Copyright (c)1993-1995 Microsoft Corporation, All Right Reserved
  9.  *
  10.  * Kraig Brockschmidt, Microsoft
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14.  
  15.  
  16. #ifndef _KOALA_H_
  17. #define _KOALA_H_
  18.  
  19. #define CHAPTER5
  20. #include <inole.h>
  21.  
  22. //KOALA.CPP
  23.  
  24. class CKoala : public IUnknown
  25.     {
  26.     protected:
  27.         ULONG           m_cRef;         //Object reference count
  28.         LPUNKNOWN       m_pUnkOuter;    //Controlling unknown
  29.  
  30.         PFNDESTROYED    m_pfnDestroy;   //To call on closure
  31.  
  32.     public:
  33.         CKoala(LPUNKNOWN, PFNDESTROYED);
  34.         ~CKoala(void);
  35.  
  36.         BOOL Init(void);
  37.  
  38.         //Non-delegating object IUnknown
  39.         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
  40.         STDMETHODIMP_(ULONG) AddRef(void);
  41.         STDMETHODIMP_(ULONG) Release(void);
  42.     };
  43.  
  44. typedef CKoala *PCKoala;
  45.  
  46. #endif //_KOALA_H_
  47.