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 / chap02 / query / interfac.h next >
C/C++ Source or Header  |  1995-05-03  |  1KB  |  49 lines

  1. /*
  2.  * INTERFAC.H
  3.  *
  4.  * Definition of ISampleOne and ISampleTwo used to demonstrate
  5.  * QueryInterface and different techniques of implementing multiple
  6.  * interfaces on an object.
  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 _INTERFAC_H_
  17. #define _INTERFAC_H_
  18.  
  19.  
  20. DECLARE_INTERFACE_(ISampleOne, IUnknown)
  21.     {
  22.     //IUnknown members
  23.     STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  24.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  25.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  26.  
  27.     //ISampleOne members
  28.     STDMETHOD(GetMessage) (THIS_ LPTSTR, UINT) PURE;
  29.     };
  30.  
  31. typedef ISampleOne *PSAMPLEONE;
  32.  
  33.  
  34. DECLARE_INTERFACE_(ISampleTwo, IUnknown)
  35.     {
  36.     //IUnknown members
  37.     STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  38.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  39.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  40.  
  41.     //ISampleTwo members
  42.     STDMETHOD(GetString) (THIS_ LPTSTR, UINT) PURE;
  43.     };
  44.  
  45. typedef ISampleTwo *PSAMPLETWO;
  46.  
  47.  
  48. #endif //_INTERFAC_H_
  49.