LoadRegistryEntries Class Reference

This class can be used for loading a list of items into the registry. More...

#include <registry.h>

List of all members.

Public Member Functions

 LoadRegistryEntries ()
 ~LoadRegistryEntries ()
 Standard destructor.
BOOL StartLoading (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 LoadNextEntry (String_256 *pNextName)
 Loads in the next entry into the opened key.
BOOL StopLoading ()
 Stops the process of loading our a series of registry entries e.g. a pathname list.
HKEY GetRegKey ()
INT32 GetNumberOfItemsLoaded ()

Private Member Functions

 CC_DECLARE_MEMDUMP (LoadRegistryEntries)

Private Attributes

HKEY m_hRegKey
INT32 m_Counter


Detailed Description

This class can be used for loading a list of items into the registry.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/02/97

Definition at line 203 of file registry.h.


Constructor & Destructor Documentation

LoadRegistryEntries::LoadRegistryEntries  )  [inline]
 

Definition at line 208 of file registry.h.

00208 { m_hRegKey = NULL; m_Counter = 0; };

LoadRegistryEntries::~LoadRegistryEntries  ) 
 

Standard destructor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/02/97

Definition at line 1345 of file registry.cpp.

01346 {
01347     if (m_hRegKey != NULL)
01348         CloseRegKey(m_hRegKey);
01349     return;
01350 }


Member Function Documentation

LoadRegistryEntries::CC_DECLARE_MEMDUMP LoadRegistryEntries   )  [private]
 

INT32 LoadRegistryEntries::GetNumberOfItemsLoaded  )  [inline]
 

Definition at line 217 of file registry.h.

00217 { return m_Counter; }

HKEY LoadRegistryEntries::GetRegKey  )  [inline]
 

Definition at line 216 of file registry.h.

00216 { return m_hRegKey; }

BOOL LoadRegistryEntries::LoadNextEntry String_256 pNextName  ) 
 

Loads in the next entry into the opened key.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/02/97
Parameters:
pNextName the next bit of data loaded from the list [INPUTS]
Returns:
TRUE if successful.

Definition at line 1302 of file registry.cpp.

01303 {
01304     if (m_hRegKey == NULL)
01305         return FALSE;
01306 
01307     // Cannot save out the item with a blank name so invent a unique name for it
01308     TCHAR buf[10];
01309     wsprintf(buf, TEXT("%d"), m_Counter + 1);
01310     m_Counter++;
01311 
01312     return GetRegString(m_hRegKey, buf, pNextName);
01313 }

BOOL LoadRegistryEntries::StartLoading 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.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/02/97
Parameters:
pKeySpecifier string specifying the key name to store the data under [INPUTS] hSubKey the sub key to start the section under, defaults to the main program section of the regsitry
Returns:
TRUE if successful.

Definition at line 1267 of file registry.cpp.

01268 {
01269     // Don't do this under Win32s.
01270     if (IsWin32s() && !IsWin32c()) return FALSE;
01271 
01272     ERROR2IF(hSubKey == NULL, FALSE, "LoadRegistryEntries::StartLoading Bad main app key ");
01273     ERROR2IF(pKeySpecifier == NULL, FALSE, "LoadRegistryEntries::StartLoading Bad key specifier");
01274     ERROR2IF(m_hRegKey != NULL, FALSE, "LoadRegistryEntries::StartLoading hRegKey is already non-null");
01275 
01276     // First open a new sub-key under the app-state key for holding the data.
01277     // e.g. TEXT("Workspace\\MDI")
01278     // Use the passed in key which will default to the main app hAppStateRegKey if not supplied
01279     m_hRegKey = OpenRegKey(hSubKey, *pKeySpecifier);
01280     if (m_hRegKey == NULL)
01281     {
01282         // don't error as some people require this functionality
01283         //ERROR3("Can't get a registry key in LoadRegistryEntries::StartLoading");
01284         return FALSE;
01285     }
01286 
01287     return TRUE;
01288 }

BOOL LoadRegistryEntries::StopLoading  ) 
 

Stops the process of loading our a series of registry entries e.g. a pathname list.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/02/97
Returns:
TRUE if successful.

Definition at line 1327 of file registry.cpp.

01328 {
01329     ERROR2IF(m_hRegKey == NULL, FALSE, "hRegKey is null");
01330     BOOL closed = CloseRegKey(m_hRegKey);
01331     m_hRegKey = NULL;
01332     return closed;
01333 }


Member Data Documentation

INT32 LoadRegistryEntries::m_Counter [private]
 

Definition at line 221 of file registry.h.

HKEY LoadRegistryEntries::m_hRegKey [private]
 

Definition at line 220 of file registry.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:04 2007 for Camelot by  doxygen 1.4.4