KOALAA.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*
  2.  * KOALAA.H
  3.  *
  4.  * Definition of the Koala object using Aggregation, Chapter 2
  5.  * Included only from KOALAA.CPP.
  6.  *
  7.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  8.  *
  9.  * Kraig Brockschmidt, Microsoft
  10.  * Internet  :  kraigb@microsoft.com
  11.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  12.  */
  13. #ifndef _KOALAA_H_
  14. #define _KOALAA_H_
  15. class CImpIKoala_A;
  16. typedef CImpIKoala_A *PCImpIKoala_A;
  17. class CKoalaA : public IUnknown
  18.     {
  19.     friend CImpIKoala_A;
  20.     private:
  21.         DWORD           m_cRef;         //Object reference count
  22.         PCImpIKoala_A   m_pImpIKoala;   //Interface implementation
  23.         IUnknown       *m_pIUnknown;    //From Animal
  24.         IAnimal        *m_pIAnimal;     //From Animal, released
  25.     public:
  26.         CKoalaA(void);
  27.         ~CKoalaA(void);
  28.         BOOL Init(void);
  29.         //IUnknown members, non-delegating
  30.         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
  31.         STDMETHODIMP_(DWORD) AddRef(void);
  32.         STDMETHODIMP_(DWORD) Release(void);
  33.     };
  34. typedef CKoalaA *PCKoalaA;
  35. class CImpIKoala_A : public IKoala
  36.     {
  37.     private:
  38.         DWORD       m_cRef;         //For debugging
  39.         PCKoalaA    m_pObj;         //Back pointer
  40.     public:
  41.         CImpIKoala_A(PCKoalaA);
  42.         ~CImpIKoala_A(void);
  43.         //IUnknown members
  44.         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
  45.         STDMETHODIMP_(DWORD) AddRef(void);
  46.         STDMETHODIMP_(DWORD) Release(void);
  47.         //IKoala members
  48.         STDMETHODIMP ClimbEucalyptusTrees(void);
  49.         STDMETHODIMP PouchOpensDown(void);
  50.         STDMETHODIMP SleepForHoursAfterEating(void);
  51.     };
  52. #endif _KOALAA_H_