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

Windows编程

开发平台:

Visual C++

  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. #ifndef _IPERSTOR_H_
  16. #define _IPERSTOR_H_
  17. #include <inole.h>
  18. class CImpIPersistStorage;
  19. typedef class CImpIPersistStorage *PCImpIPersistStorage;
  20. class CImpIPersistStorage : public IPersistStorage
  21.     {
  22.     protected:
  23.         ULONG           m_cRef;      //Interface reference count
  24.         LPVOID          m_pObj;      //Backpointer to the object
  25.         LPUNKNOWN       m_pUnkOuter; //For delegation
  26.         PSSTATE         m_psState;   //Current State
  27.     public:
  28.         CImpIPersistStorage(LPVOID, LPUNKNOWN);
  29.         ~CImpIPersistStorage(void);
  30.         STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  31.         STDMETHODIMP_(ULONG) AddRef(void);
  32.         STDMETHODIMP_(ULONG) Release(void);
  33.         STDMETHODIMP GetClassID(LPCLSID);
  34.         STDMETHODIMP IsDirty(void);
  35.         STDMETHODIMP InitNew(LPSTORAGE);
  36.         STDMETHODIMP Load(LPSTORAGE);
  37.         STDMETHODIMP Save(LPSTORAGE, BOOL);
  38.         STDMETHODIMP SaveCompleted(LPSTORAGE);
  39.         STDMETHODIMP HandsOffStorage(void);
  40.     };
  41. #endif  //_IPERSTOR_H_