IPropertyStorage

Manages the persistent properties of a single property set. Persistent properties consist of information that can be stored persistently in a property set, such as the summary information associated with a file. This contrasts with run-time properties associated with Controls and Automation, which can be used to affect system behavior. Use the methods of the IPropertySetStorage interface to create or open a persistent property set. An IPropertySetStorage instance can manage zero or more IPropertyStorage instances.

Each property within a property set is identified by a property identifier, a four-byte ULONG value unique to that set. You can also assign a string name to a property through the IPropertyStorage interface.

Property identifiers are different from the dispatch identifiers used in Automation dispid property name tags. One difference is that the general-purpose use of property identifier values zero and one is prohibited in IPropertyStorage, while no such restriction exists in IDispatch. In addition, while there is significant overlap in the data types for property values that may be used in IPropertyStorage and IDispatch, the sets are not identical. Persistent property data types used in IPropertyStorage methods are defined in the PROPVARIANT structure.

When to Implement

Implement IPropertyStorage when you want to store properties in the file system. If you are using the OLE compound files implementation, the compound file object created through a call to StgCreateDocfile includes an implementation of IPropertySetStorage, which allows access to the implementation of IPropertyStorage. Once you have a pointer to any of the interface implementations (such as IStorage) on this object, you can call QueryInterface to get a pointer to the IPropertySetStorage interface implementation, and then call either the Open or Create method, as appropriate to obtain a pointer to the IPropertyStorage interface managing the specified property set.

When to Use

Use IPropertyStorage to create and manage properties that are stored in a given property set.

Methods in Vtable Order

IUnknown Methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IPropertyStorage Methods Description
ReadMultiple Reads property values in a property set.
WriteMultiple Writes property values in a property set.
DeleteMultiple Deletes properties in a property set.
ReadPropertyNames Gets corresponding string names for given property identifiers.
WritePropertyNames Creates or changes string names corresponding to given property identifiers.
DeletePropertyNames Deletes string names for given property identifiers.
SetClass Assigns a CLSID to the property set.
Commit As in IStorage::Commit, flushes or commits changes to the property storage object.
Revert When the property storage is opened in transacted mode, discards all changes since the last commit.
Enum Creates and gets a pointer to an enumerator for properties within this set.
Stat Receives statistics about this property set.
SetTimes Sets modification, creation, and access times for the property set.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.

See Also

IPropertySetStorage, IEnumSTATPROPSTG, IEnumSTATPROPSETSTG, STATPROPSTG, STATPROPSETSTG, PROPVARIANT