Click to return to the Component Development home page    
IPropertyBag::Write     IPropertyBag2::CountPrope...     Component Interface Refer...    
Web Workshop  |  Component Development

IPropertyBag2 Interface


The IPropertyBag2 interface provides an object with a property bag in which the object can persistently save its properties.

IPropertyBag2 Methods

CountProperties Retrieves the number of properties in the property bag.
GetPropertyInfo Retrieves information for properties in a property bag without actually retrieving the properties themselves.
LoadObject Causes the property bag to instruct a previously created and initialized property object 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.

Interface Information

Implementation Custom
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

Remarks

When a client wants to have exact control over how individually named properties of an object are saved, it uses an object's IPersistPropertyBag2 interface as a persistence mechanism. In that case, 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 through the use of the CountProperties and GetPropertyInfo methods. 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.

See Also

IPropertyBag, PROPBAG2, PROPBAG2_TYPE



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.