home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activedocument / doserver / dataobj.h < prev    next >
C/C++ Source or Header  |  1997-05-28  |  3KB  |  96 lines

  1. /**************************************************************************
  2.    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3.    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4.    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5.    PARTICULAR PURPOSE.
  6.  
  7.    Copyright 1997 Microsoft Corporation.  All Rights Reserved.
  8. **************************************************************************/
  9.  
  10. /**************************************************************************
  11.  
  12.    File:          DataObj.h
  13.    
  14.    Description:   CDataObject and CEnumForamtEtc definitions.
  15.  
  16. **************************************************************************/
  17.  
  18. #ifndef DATAOBJECT_H
  19. #define DATAOBJECT_H
  20.  
  21. /**************************************************************************
  22.    #include statements
  23. **************************************************************************/
  24.  
  25. #include "DOServer.h"
  26.  
  27. #define CF_EMBEDSOURCE      TEXT("Embed Source")
  28.  
  29. /**************************************************************************
  30.  
  31.    CDataObject class defintion
  32.  
  33. **************************************************************************/
  34.  
  35. class COleDocument;
  36.  
  37. class CDataObject : public IDataObject
  38. {
  39. private:
  40.     COleDocument         *m_pOleDoc;
  41.    LPDATAADVISEHOLDER   m_pDataAdviseHolder;
  42.    UINT                 m_cfEmbedSource;
  43.  
  44. public:
  45.     CDataObject::CDataObject(COleDocument*);
  46.     CDataObject::~CDataObject(void);
  47.  
  48.     //IUnknown methods
  49.     STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  50.     STDMETHODIMP_(ULONG) AddRef();
  51.     STDMETHODIMP_(ULONG) Release();
  52.  
  53.     //IDataObject methods
  54.     STDMETHODIMP DAdvise(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD);
  55.     STDMETHODIMP DUnadvise(DWORD);
  56.     STDMETHODIMP EnumDAdvise(LPENUMSTATDATA*);
  57.     STDMETHODIMP EnumFormatEtc(DWORD, LPENUMFORMATETC*);
  58.     STDMETHODIMP GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC);
  59.     STDMETHODIMP GetData(LPFORMATETC, LPSTGMEDIUM);
  60.     STDMETHODIMP GetDataHere(LPFORMATETC, LPSTGMEDIUM);
  61.     STDMETHODIMP QueryGetData(LPFORMATETC);
  62.     STDMETHODIMP SetData(LPFORMATETC, LPSTGMEDIUM, BOOL);
  63.  
  64. };
  65.  
  66. /**************************************************************************
  67.  
  68.    CEnumFormatEtc class defintion
  69.  
  70. **************************************************************************/
  71.  
  72. class CEnumFormatEtc : public IEnumFORMATETC
  73. {
  74. private: 
  75.     ULONG         m_ObjRefCount; // Object reference count
  76.     ULONG           m_iCur;        // Current element
  77.    UINT        m_cfEmbedSource;
  78.  
  79. public: 
  80.     CEnumFormatEtc(void);
  81.     ~CEnumFormatEtc(void);
  82.  
  83.     // IUnknown members that delegate to m_pUnkOuter
  84.     STDMETHODIMP         QueryInterface(REFIID, LPVOID*);
  85.     STDMETHODIMP_(ULONG) AddRef(void);
  86.     STDMETHODIMP_(ULONG) Release(void);
  87.  
  88.     // IEnumFORMATETC members
  89.     STDMETHODIMP Next(ULONG, LPFORMATETC, ULONG*);
  90.     STDMETHODIMP Skip(ULONG);
  91.     STDMETHODIMP Reset(void);
  92.     STDMETHODIMP Clone(LPENUMFORMATETC*);
  93. };
  94.  
  95. #endif   //DATAOBJECT_H
  96.