|
|
|
IPersistStream Interface |
|
IID_IPersistStream |
{00000109-0000-0000-C000-000000000046} |
|
The IPersistStream interface provides methods for saving and loading objects that use a simple serial stream for their storage needs. The IPersistStream interface inherits its definition from the IPersist interface, and so includes the GetClassID method of IPersist.
One way in which it is used is to support OLE moniker implementations. Each of the OLE-provided moniker interfaces provides an IPersistStream implementation through which the moniker saves or loads itself. An instance of the OLE generic composite moniker class calls the IPersistStream methods of its component monikers to load or save the components in the proper sequence in a single stream.
OLE containers with embedded and linked component objects do not use this interface; they use the IPersistStorage interface instead.
Call methods of IPersistStream from a container application to save or load objects that are contained in a simple stream. When used to save or load monikers, typical applications do not call the methods directly, but allow the default link handler to make the calls to save and load the monikers that identify the link source. These monikers are stored in a stream in the storage for the linked object. If you are writing a custom link handler for your class of objects, you would call the methods of IPersistStream to implement the link handler.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IPersist Method |
Description |
|
GetClassID |
Returns the class identifier (CLSID) for the component object. |
|
IPersistStream Methods |
Description |
|
IsDirty |
Checks the object for changes since it was last saved. |
|
Load |
Initializes an object from the stream where it was previously saved. |
|
Save |
Saves an object into the specified stream and indicates whether the object should reset its dirty flag. |
|
GetSizeMax |
Return the size in bytes of the stream needed to save the object. |
|
IsDirty |
|
FUNCTION IPersistStream_IsDirty ( _ BYVAL pthis AS DWORD PTR _ ) AS LONG
LOCAL HRESULT AS LONG
|
|
FUNCTION IPersistStream_IsDirty ( _ BYVAL pthis AS DWORD PTR _ ) AS LONG ! mov eax, pthis
|
|
Load |
|
FUNCTION IPersistStream_Load ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pStm AS DWORD _ ) AS LONG
LOCAL HRESULT AS LONG
|
|
FUNCTION IPersistStream_Load ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pStm AS DWORD _ ) AS LONG ! push pStm ! mov eax, pthis
|
|
Save |
|
FUNCTION IPersistStream_Save ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pStm AS DWORD _ , BYVAL fClearDirty AS LONG _ )
AS LONG
LOCAL HRESULT AS LONG
|
|
FUNCTION IPersistStream_Save ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pStm AS DWORD _ , BYVAL fClearDirty AS LONG _ )
AS LONG ! push fClearDirty ! push pStm ! mov eax, pthis
|
|
GetSizeMax |
|
FUNCTION IPersistStream_GetSizeMax ( _ BYVAL pthis AS DWORD PTR _ , BYREF pcbSize AS QUAD _ ) AS LONG
LOCAL HRESULT AS LONG
|
|
FUNCTION IPersistStream_GetSizeMax ( _ BYVAL pthis AS DWORD PTR _ , BYREF pcbSize AS QUAD _ ) AS LONG ! push pcbSize ! mov eax, pthis
|
Page last updated on Monday, 03 April 2006 20:22:30 +0200