Export (0) Print
Expand All

IPropertyBag2 Interface

Provides an object with a property bag in which the object can save its properties persistently.

IPropertyBag2 Members

CountProperties Gets the number of properties in the property bag.
GetPropertyInfo Gets information for properties in a property bag without actually getting those properties.
LoadObject Causes the property bag to instruct a property object that was previously created and initialized to read its persistent properties.
Read Causes one or more properties to be read from the property bag.
Write Causes one or more properties to be saved into the property bag.


When a client wants to control how the individually named properties of an object are saved, it uses an object's IPersistPropertyBag2 interface as a persistence mechanism. The client supplies a property bag to the object in the form of an IPropertyBag2 interface.

IPropertyBag2 is an enhancement of the IPropertyBag interface. IPropertyBag2 allows the object to obtain type information for each property by using the CountProperties method and the GetPropertyInfo method. A property bag that implements IPropertyBag2 must also support IPropertyBag, so that objects that only support IPropertyBag can access their properties. Also, an object that supports IPropertyBag2 must also support IPropertyBag so that the object can communicate with property bags that only support IPropertyBag.

Interface Information

Stock Implementation None
Custom Implementation Yes
Inherits from IUnknown
Header and IDL files Ocidl.h, Ocidl.idl
Minimum availability Internet Explorer 4.0
Minimum operating systems Windows 95, Windows NT 4.0

See Also

Community Additions

© 2015 Microsoft