#include <registry.h>
Public Member Functions | |
SaveRegistryEntries () | |
~SaveRegistryEntries () | |
Standard destructor. | |
BOOL | StartSaving (String_256 *pKeySpecifier, HKEY hSubKey=hAppStateRegKey) |
Starts the process of saving our a series of registry entries e.g. a pathname list. A sub-key to the main section can be specified so that instead of opening the section <program> \ *pKeySpecifier it opens a sub-section to this. | |
BOOL | SaveNextEntry (String_256 *pNextName) |
Saves out the next entry into the opened key. | |
BOOL | StopSaving () |
Stops the process of saving our a series of registry entries e.g. a pathname list. | |
HKEY | GetRegKey () |
Private Member Functions | |
CC_DECLARE_MEMDUMP (SaveRegistryEntries) | |
Private Attributes | |
HKEY | m_hRegKey |
INT32 | m_Counter |
Definition at line 172 of file registry.h.
|
Definition at line 177 of file registry.h.
|
|
Standard destructor.
Definition at line 1240 of file registry.cpp. 01241 { 01242 if (m_hRegKey != NULL) 01243 CloseRegKey(m_hRegKey); 01244 return; 01245 }
|
|
|
|
Definition at line 185 of file registry.h. 00185 { return m_hRegKey; }
|
|
Saves out the next entry into the opened key.
Definition at line 1197 of file registry.cpp. 01198 { 01199 if (m_hRegKey == NULL) 01200 return FALSE; 01201 01202 // Cannot save out the item with a blank name so invent a unique name for it 01203 TCHAR buf[10]; 01204 wsprintf(buf, TEXT("%d"), m_Counter + 1); 01205 m_Counter++; 01206 01207 return SetRegValue(m_hRegKey, buf, REG_SZ, *pNextName, pNextName->Length() + 1); 01208 }
|
|
Starts the process of saving our a series of registry entries e.g. a pathname list. A sub-key to the main section can be specified so that instead of opening the section <program> \ *pKeySpecifier it opens a sub-section to this.
Definition at line 1149 of file registry.cpp. 01150 { 01151 // Don't do this under Win32s. 01152 if (IsWin32s() && !IsWin32c()) return FALSE; 01153 01154 ERROR2IF(hSubKey == NULL, FALSE, "SaveRegistryEntries::StartSaving Bad main app key"); 01155 ERROR2IF(pKeySpecifier == NULL, FALSE, "SaveRegistryEntries::StartSaving Bad key specifier"); 01156 ERROR2IF(m_hRegKey != NULL, FALSE, "SaveRegistryEntries::StartSaving hRegKey is already non-null"); 01157 01158 // Ensure the section is blank before we start saving any data 01159 DeleteRegKey(hSubKey, *pKeySpecifier); 01160 01161 // First open/create a new sub-key under the app-state key for holding the data. 01162 // e.g. TEXT("Workspace\\MDI") 01163 // Use the passed in key which will default to the main app hAppStateRegKey if not supplied 01164 m_hRegKey = CreateRegKey(hSubKey, *pKeySpecifier); 01165 if (m_hRegKey == NULL) 01166 { 01167 ERROR3("Can't get a registry key in SaveRegistryEntries::StartSaving"); 01168 return FALSE; 01169 } 01170 01171 // Ensure the section is blank before we start saving any data 01172 /* BOOL ok = TRUE; 01173 TCHAR buf[10]; 01174 INT32 i = 0; 01175 while (ok) 01176 { 01177 wsprintf(buf, TEXT("%d"), i + 1); 01178 i++; 01179 ok = DeleteRegKey(m_hRegKey, buf); 01180 } 01181 */ 01182 return TRUE; 01183 }
|
|
Stops the process of saving our a series of registry entries e.g. a pathname list.
Definition at line 1222 of file registry.cpp. 01223 { 01224 ERROR2IF(m_hRegKey == NULL, FALSE, "hRegKey is null"); 01225 BOOL closed = CloseRegKey(m_hRegKey); 01226 m_hRegKey = NULL; 01227 return closed; 01228 }
|
|
Definition at line 189 of file registry.h. |
|
Definition at line 188 of file registry.h. |