Class TMyPersistStorage (unit myOle)

Inherits from

IPersistStorage

IPersistStorage interface } // TMyPersistStorage can be only used as part of another object. If you would like to change this, // you have to change following functions: QueyInterface, AddRef and Relase

Constructors


constructor Create(OleOuter: TMyOle);

////////////////////////////////////////////////////////////////////////////// /// TMyPersistStorage //////////////////////////////////////////////////////////////////////////////


Functions

function AddRef: Longint;

delegates call to outer object

destructor Destroy;

iunknown methods

precreate, so we do not consume memory during .


function GetClassID(var classID: TCLSID): HResult;

delegates call to outer object

function HandsOffStorage: HResult;

release old storage

function InitNew(stg: IStorage): HResult;

IPersistStorage methods

Object has not changed since last Save


function IsDirty: HResult;

IPersist method

IPersist method


function Load(stg: IStorage): HResult;

was wrong in 0.

function QueryInterface(const iid: TIID; var obj): HResult;


function Release: Longint;

delegates call to outer object

function Save(stgSave: IStorage; fSameAsLoad: BOOL): HResult;

release delphi stream ** We do not call openedStream.

function SaveCompleted(stgNew: IStorage): HResult;

Ok,ok we should check if write was successfull

Properties

Events

Variables

ds : TOleStream;


fOleOuter : TMyOle;


FRefCount : Integer;


fStorage : IStorage;

pointer to outer object

fStream : IStream;



Constructors


constructor Create(OleOuter: TMyOle);

////////////////////////////////////////////////////////////////////////////// /// TMyPersistStorage //////////////////////////////////////////////////////////////////////////////


Functions


function AddRef: Longint;

delegates call to outer object


destructor Destroy;

iunknown methods

precreate, so we do not consume memory during .Save


function GetClassID(var classID: TCLSID): HResult;

delegates call to outer object


function HandsOffStorage: HResult;

release old storage


function InitNew(stg: IStorage): HResult;

IPersistStorage methods

Object has not changed since last Save


function IsDirty: HResult;

IPersist method

IPersist method


function Load(stg: IStorage): HResult;

was wrong in 0.9


function QueryInterface(const iid: TIID; var obj): HResult;


function Release: Longint;

delegates call to outer object


function Save(stgSave: IStorage; fSameAsLoad: BOOL): HResult;

release delphi stream ** We do not call openedStream.Release because we may need it for a low-memory ** save in Save. We also need to hold onto a copy of Istorage, menanig AddRef


function SaveCompleted(stgNew: IStorage): HResult;

Ok,ok we should check if write was successfull


Properties


Events


Variables


ds : TOleStream;


fOleOuter : TMyOle;


FRefCount : Integer;


fStorage : IStorage;

pointer to outer object


fStream : IStream;