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 / perstor.h < prev    next >
C/C++ Source or Header  |  1997-05-28  |  2KB  |  72 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:          PerStor.h
  13.    
  14.    Description:   CPersistStorage definitions.
  15.  
  16. ******************************************************************************/
  17.  
  18. #ifndef PERSISTSTORAGE_H
  19. #define PERSISTSTORAGE_H
  20.  
  21. /**************************************************************************
  22.    #include statements
  23. **************************************************************************/
  24.  
  25. #include "DOServer.h"
  26.  
  27. /**************************************************************************
  28.  
  29.    CPersistStorage class definition
  30.  
  31. **************************************************************************/
  32.  
  33. class COleDocument;
  34.  
  35. class CPersistStorage : public IPersistStorage
  36. {
  37. friend class CPersistFile;
  38.  
  39. private:
  40.    COleDocument   *m_pOleDoc;
  41.    LPSTORAGE      m_pStorage;
  42.    LPSTREAM       m_pColorStream;
  43.    BOOL           m_fSameAsLoad;
  44.  
  45. public:
  46.    CPersistStorage(COleDocument*);
  47.    ~CPersistStorage();
  48.  
  49.    //IUnknown methods
  50.    STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  51.    STDMETHODIMP_(DWORD) AddRef();
  52.    STDMETHODIMP_(DWORD) Release();
  53.  
  54.    //IPersistStorage methods
  55.     STDMETHODIMP InitNew(LPSTORAGE);
  56.     STDMETHODIMP GetClassID(LPCLSID);
  57.     STDMETHODIMP Save(LPSTORAGE, BOOL);
  58.     STDMETHODIMP SaveCompleted(LPSTORAGE);
  59.     STDMETHODIMP Load(LPSTORAGE);
  60.     STDMETHODIMP IsDirty();
  61.     STDMETHODIMP HandsOffStorage();
  62.    
  63. private:
  64.     void ReleaseStreamsAndStorage();
  65.     void OpenStreams(LPSTORAGE);
  66.     void CreateStreams(LPSTORAGE);
  67.     void CreateStreams(LPSTORAGE, LPSTREAM*);
  68.  
  69. };
  70.  
  71. #endif   //PERSISTSTORAGE_H
  72.