
CHKLM v1.17 An MFC class to write to HKEY_LOCAL_MACHINE
(Obsolete)
Welcome to CHKLM, A simple MFC class
to allow you to write values to the HKEY_LOCAL_MACHINE registry key instead of
HKEY_CURRENT_USER which the MFC functions limit you to. The class is not designed to be a
complete registry class, instead it provides functions similar in style to the MFC ones.
Full source code is provided for those
interested. A VC 6 workspace file is included which builds a simple demo console
application which calls the class methods.
Features
- Simple and clean C++ interface based upon
the MFC functions
- The classes are fully Unicode compliant and
include Unicode built options in the workspace file.
- Full documentation is provided in the form
of a HTML file
The enclosed
zip file contains the
CHKLM source code and a simple console based application which exercises the class.
Copyright
- You are allowed to include the source code in
any product (commercial, shareware, freeware or otherwise) when your product
is released in binary form.
- You are allowed to modify the source code in
any way you want except you cannot modify the copyright details at the top
of each module.
- If you want to distribute source code with
your application, then you are only allowed to distribute versions released
by the author. This is to maintain a single distribution point for the
source code.
Updates
V1.0 (27 June 1998)
V1.01 (14 July 1999)
- Now ships with a VC 5
workspace instead of VC 6.
- Tidied up the documentation
file.
- Unicode Build configurations
now actually compile and work <g>.
V1.1 (3 October 1999)
- Addition of GetProfileStringArray and
WriteProfileStringArray methods.
V1.11 (9 August 2001)
- Updated copyright message
- Fixed an issue where the class fails to read any key that is readonly. This is a problem since Win2000 defaults access to HKLM for "normal" users to readonly. Thanks to Hans-Georg Ulrich for spotting this problem
- Removed an unreferenced function from the hklm header file
- Fixed a memory overwrite problem in CHKLM::SetStringArrayIntoRegistry. Thanks to BoundsChecker on spotting this problem.
- Fixed a problem in CHKLM::SetStringArrayIntoRegistry with the calculation of the size to be used in the call to RegSetValueEx
- GetStringArrayFromRegistry now use RegQueryValueEx to get the size of the data it contains.
- Sample app has now uses CWinApp to make it easier for testing.
V1.12 (12 October 2001)
- Now allows application name to be overridden using new
method namely, SetProductNameRegistryKey. Thanks to Rene M. Laviolette for
this suggestion.
V1.13 (23 July 2004)
- Now ships with a VC 6
workspace instead of VC 5.
- Fixed a simple 64 bit INT_PTR compilation warning when
compiled in VC 7.1
V1.14 (11 November 2004)
- Fixed a compiler warning when Force conformance in for loop option is set in VC 7.1
- Addition of a HKLM_EXT_CLASS preprocessor macro which allows the class
to be easily added to an extension dll
V1.15 (26 March 2005)
- Addition of a m_bProfileWriteFlush variable to the clas which dictates if the registry settings should be commited immediately as oppossed to relying on the lazy writer.
v1.16 (11 June 2006)
- Fixed a bug in CHKLM::WriteProfileBinary where the optional flushing was
being done after the registry key was closed.
- Updated copyright details.
- Updated the documentation to use the same style as the web site.
- Please note that I have discontinued development of this code. Instead
please check out AppSettings, a collection of classes to encapsulate
Application settings which implements a much bigger superset of the
functionality provided by CHKLM.
V1.17 (20 July 2006)
- Code now uses newer C++ style casts instead of C style casts.
- Updated the code to clean compile on VC 2005