The straight WIN32API program I'm writing (no MFC, no .NET) uses the registry. Should a registry error occur, I'd like to print the full path of the key that failed.
HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, and HKEY_USERS are HKEY (DWORD) values (0x8000000 for HKEY_CLASSES_ROOT), etc. The subkey is a LPCTSTR, as is the value name.
Is there a method to convert the HKEY, subkey and value name (including any redirection (http://msdn.microsoft.com/en-us/library/windows/desktop/ms724072(v=vs.85).aspx)) to a text string?
I realize I can build a table of the HKEY's myself, and they're unlikely to change, but that's a crass way to do it.