CSettingsStore Class
Wraps Windows API functions, providing an object-oriented interface that you use to access the registry.
class CSettingsStore : public CObject
Members
Public Constructors
Name |
Description |
---|---|
Constructs a CSettingsStore object. |
Public Methods
Name |
Description |
---|---|
Closes the open registry key. |
|
Opens the specified key or creates it if it does not exist. |
|
Deletes the specified key and all its children. |
|
Deletes the specified value of the open key. |
|
Opens the specified key. |
|
Retrieves the data for a specified key value. |
|
Writes a value to the registry under the open key. |
Remarks
The member functions CreateKey and Open are very similar. If the registry key already exists, CreateKey and Open function in the same way. However, if the registry key does not exist, CreateKey will create it whereas Open will return an error value.
Example
The following example demonstrates how to use the Open and Read methods of the CSettingsStore class. This code snippet is part of the ToolTipDemo Sample: Demonstrates Advanced MFC ToolTip Features.
CSettingsStore reg (FALSE, TRUE);
DWORD dwEnableBalloonTips = 1;
if (reg.Open (_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced")) &&
reg.Read (_T("EnableBalloonTips"), dwEnableBalloonTips))
{
return dwEnableBalloonTips == 1;
}
Inheritance Hierarchy
Requirements
Header: afxsettingsstore.h