Expand Minimize

IPropertyStorage interface

The IPropertyStorage interface 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 instance of the IPropertySetStorage interface can manage zero or more IPropertyStorage instances.

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

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

The IPropertyStorage interface can be used to access both simple and nonsimple property sets. Nonsimple property sets can hold several complex property types that cannot be held in a simple property set. For more information see Storage and Stream Objects for a Property Set.

When to implement

Implement IPropertyStorage when you want to store properties in an object. If you are using the COM 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.

Members

The IPropertyStorage interface inherits from the IUnknown interface. IPropertyStorage also has these types of members:

Methods

The IPropertyStorage interface has these methods.

MethodDescription
Commit

As in IStorage::Commit, flushes or commits changes to the property storage object.

DeleteMultiple

Deletes properties in a property set.

DeletePropertyNames

Deletes string names for given property identifiers.

Enum

Creates and gets a pointer to an enumerator for properties within this set.

ReadMultiple

Reads property values in a property set.

ReadPropertyNames

Gets corresponding string names for given property identifiers.

Revert

When the property storage is opened in transacted mode, discards all changes since the last commit.

SetClass

Assigns a CLSID to the property set.

SetTimes

Sets modification, creation, and access times for the property set.

Stat

Receives statistics about this property set.

WriteMultiple

Writes property values in a property set.

WritePropertyNames

Creates or changes string names corresponding to given property identifiers.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Propidl.h (include Objbase.h)

IDL

Propidl.idl

Library

Uuid.lib

DLL

Ole32.dll

IID

IID_IPropertyStorage is defined as 00000138-0000-0000-C000-000000000046

See also

Managing Properties
Property Storage Considerations
IPropertySetStorage
IEnumSTATPROPSTG
IEnumSTATPROPSETSTG
STATPROPSTG
STATPROPSETSTG
PROPVARIANT
IPropertyStorage-Compound File Implementation
IPropertyStorage-NTFS File System Implementation
IPropertyStorage-Stand-alone Implementation
Samples

 

 

Community Additions

ADD
Show:
© 2014 Microsoft