I uploaded on GitHub some C++ code of mine that wraps some Windows registry C-interface APIs, using RAII, STL classes like std::wstring and std::vector, and signals error conditions using exceptions.
Using these high-level C++ wrappers, you can easily access the Windows registry with simple code like this:
// Open a registry key RegKey key{ HKEY_CURRENT_USER, LR"(SOFTWARE\MyKey\SubKey)" }; // Read a DWORD value DWORD dw = key.GetDwordValue(L"MyValue1"); // Read a string value wstring s = key.GetStringValue(L"MyValue2"); // Enumerate the values under the given key auto values = key.EnumValues(); // etc.
On the May issue of MSDN Magazine you’ll find an article describing some of the techniques applied in this code.
EDIT 2017-05-02: Added link to my MSDN Magazine article.