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

  1. /*
  2.  * IPERSTOR.H
  3.  *
  4.  * Definitions of a template IPersistStorage interface
  5.  * implementation.  Note that this template includes
  6.  * state flags used in the implementation to track the
  7.  * scribble, no scribble, and hands-off states.
  8.  *
  9.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  10.  *
  11.  * Kraig Brockschmidt, Microsoft
  12.  * Internet  :  kraigb@microsoft.com
  13.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  14.  */
  15.  
  16.  
  17. #ifndef _IPERSTOR_H_
  18. #define _IPERSTOR_H_
  19.  
  20. #include <inole.h>
  21.  
  22. class CImpIPersistStorage;
  23. typedef class CImpIPersistStorage *PCImpIPersistStorage;
  24.  
  25. class CImpIPersistStorage : public IPersistStorage
  26.     {
  27.     protected:
  28.         ULONG           m_cRef;      //Interface reference count
  29.         LPVOID          m_pObj;      //Backpointer to the object
  30.         LPUNKNOWN       m_pUnkOuter; //For delegation
  31.         PSSTATE         m_psState;   //Current State
  32.  
  33.  
  34.     public:
  35.         CImpIPersistStorage(LPVOID, LPUNKNOWN);
  36.         ~CImpIPersistStorage(void);
  37.  
  38.         STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  39.         STDMETHODIMP_(ULONG) AddRef(void);
  40.         STDMETHODIMP_(ULONG) Release(void);
  41.  
  42.         STDMETHODIMP GetClassID(LPCLSID);
  43.  
  44.         STDMETHODIMP IsDirty(void);
  45.         STDMETHODIMP InitNew(LPSTORAGE);
  46.         STDMETHODIMP Load(LPSTORAGE);
  47.         STDMETHODIMP Save(LPSTORAGE, BOOL);
  48.         STDMETHODIMP SaveCompleted(LPSTORAGE);
  49.         STDMETHODIMP HandsOffStorage(void);
  50.     };
  51.  
  52.  
  53. #endif  //_IPERSTOR_H_
  54.