Registry Property Bag

The registry property bag implementation stores the information in a given key in the registry. The implementation assumes that the user executing the application has read/write rights in the HKEY_CURRENT_USER key in the registry.

The Init() method in this IPersistenceStrategy implementation expects the name of the registry key where the data will be stored. The string passed must be the relative path of the key within the windows registry database, assuming HKEY_CURRENT_USER as the starting point. For example:

 

pPropBagInit->Init (“Software\\MyCompany\\MyApp\\Data”)

This directs all input and output queries to the property bag to the registry key HKEY_CURRENT_USER\Software\MyCompany\MyApp\Data.

The Commit() method does not have any effect in the case of Registry property bags, but it is a good idea to use it always after Load() and Save() operations to enhance the transparency of the media.