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 / ienumfe.h < prev    next >
C/C++ Source or Header  |  1996-05-21  |  2KB  |  57 lines

  1. /*
  2.  * IENUMFE.H
  3.  *
  4.  * Definitions of a FORMATETC enumerator.
  5.  *
  6.  * Copyright (c)1993-1995 Microsoft Corporation, All Right Reserved
  7.  *
  8.  * Kraig Brockschmidt, Microsoft
  9.  * Internet  :  kraigb@microsoft.com
  10.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  11.  */
  12.  
  13.  
  14. #ifndef _IENUMFE_H_
  15. #define _IENUMFE_H_
  16.  
  17. #include <inole.h>
  18.  
  19. /*
  20.  * IEnumFORMATETC object that is created from
  21.  * IDataObject::EnumFormatEtc.  This object lives on its own,
  22.  * that is, QueryInterface only knows IUnknown and IEnumFormatEtc,
  23.  * nothing more.  We still use an outer unknown for reference
  24.  * counting, because as long as this enumerator lives, the data
  25.  * object should live, thereby keeping the application up.
  26.  */
  27.  
  28. class CEnumFormatEtc;
  29. typedef class CEnumFormatEtc *PCEnumFormatEtc;
  30.  
  31. class CEnumFormatEtc : public IEnumFORMATETC
  32.     {
  33.     private:
  34.         ULONG           m_cRef;     //Object reference count
  35.         ULONG           m_iCur;     //Current element
  36.         ULONG           m_cfe;      //Number of FORMATETCs in us
  37.         LPFORMATETC     m_prgfe;    //Source of FORMATETCs
  38.  
  39.     public:
  40.         CEnumFormatEtc(ULONG, LPFORMATETC);
  41.         ~CEnumFormatEtc(void);
  42.  
  43.         //IUnknown members
  44.         STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
  45.         STDMETHODIMP_(ULONG) AddRef(void);
  46.         STDMETHODIMP_(ULONG) Release(void);
  47.  
  48.         //IEnumFORMATETC members
  49.         STDMETHODIMP Next(ULONG, LPFORMATETC, ULONG *);
  50.         STDMETHODIMP Skip(ULONG);
  51.         STDMETHODIMP Reset(void);
  52.         STDMETHODIMP Clone(IEnumFORMATETC **);
  53.     };
  54.  
  55.  
  56. #endif //_IENUMFE_H_
  57.