Click to Rate and Give Feedback
MSDN
MSDN Library
COM
COM Fundamentals
Reference
Interfaces
IPersistStreamInit
COM
IPersistStreamInit

The IPersistStreamInit interface is defined as a replacement for IPersistStream in order to add an initialization method, InitNew. This interface is not derived from IPersistStream; it is mutually exclusive with IPersistStream. An object chooses to support only one of the two interfaces, based on whether it requires the InitNew method. Otherwise, the signatures and semantics of the other methods are the same as the corresponding methods of IPersistStream, except as described below.

Implement this interface on any object that needs to support initialized stream-based persistence, regardless of whatever else the object does. The presence of the InitNew method requires some changes to other methods that are common to IPersistStream, as noted in the method descriptions.

Use this interface to initialize a stream-based object and to save that object to a stream.

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.

IPersistStreamInit 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.

InitNew

Initializes an object to a default state.

For an explanation of the requirement values, see Requirements (COM).

Windows NT/2000/XP: Requires Windows NT 3.1 or later.

Windows 95/98: Requires Windows 95 or later.

Header: Declared in ocidl.h.

Reference

IPersistStream

Send comments about this topic to Microsoft.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker