CPropertyContainer Class

class CPropertyContainer: public CRefCountImpl

This class provides a default implementation of the IPropertyContainer interface. This class stores an entry in map for each property. Each entry in the property map contains an IProperty pointer and a pointer to a property accessor. The GetPropertyValue and PutPropertyValue methods are implemented by looking up the property in the map and using the accessor to either store or retrieve the value. Properties are registered with the property container using the RegisterProperty method.

Defined in: PropContainer.h

Class Members

bool RegisterProperty(IProperty* pProp)

Register a property with the container.

virtual int GetPropertyCount() const

Get the number of properties in the container.

virtual IProperty* GetPropertyAt(const int nPropIdx) const

Get the property using an index into the container.

virtual IProperty* GetProperty(const PropertyId propId) const

Retrieve a property by unique identifier.

virtual IProperty* GetPropertyByName(OLECHAR* propName) const

Retrieve a property by name.

virtual bool GetCategoryName(const int nCatId, BSTR& catName) const

Return the string name of a property category.

virtual bool GetPropertyValue(const PropertyId propId, VARIANT& propVal) const

Get a property value using the property ID.

virtual bool GetPropertyContainer(const PropertyId propId, IPropertyContainer** container) const

Retrieve a pointer to a nested property container.

virtual bool GetPropertyString(const PropertyId propId, BSTR& propVal) const

Get a property value as a string using the property ID.

virtual bool PutPropertyValue(const PropertyId propId, const VARIANT& propVal)

Set a property value using the property ID.

virtual bool PutPropertyString(const PropertyId propId, const BSTR& propVal)

Set a property value as string using the property ID.