if(pStream) delete pStream;
}
//---------------------------------------------------------------------------
他开辟了很大的内存,用于保存流,下面是msdn上的IPersistStreamInit定义
interface IPersistStream : IPersist {
//IUnknown members and GetClassID from IPersist
HRESULT IsDirty(void);
HRESULT Load(IStream *pStm);
HRESULT Save(IStream *pStm, BOOL fClearDirty);
HRESULT GetSizeMax(ULARGE_INTEGER *pcbSize); };
interface IPersistStreamInit : IPersist { HRESULT InitNew(void); };
这里涌到的save如下
Instructs the object to save its persistent data at the current seek offset of the given stream. The object must save its data and return without holding the IStream pointer. The fClearDirty argument tells the object whether it should consider itself clean after this call-a client may be making a copy of the object as opposed to saving its data permanently, and this flag distinguishes the cases.