Original Post
I''m trying to write to the registry using the TRegistry object in Borland C++ Builder 6, but for some reason I cannot access HKEY_LOCAL_MACHINE and write strings to it. For instance, here is my code
TRegistry *Reg = new TRegistry();
Reg->RootKey = HKEY_LOCAL_MACHINE;
Reg->CreateKey("SOFTWARE\\MySoftware");
Reg->OpenKey("SOFTARE\\MySoftware", false);
Reg->WriteString("licence", "0");
Reg->CloseKey();
Reg->Free();
But when I execute this, I get an error saying "Failed to set data for ''licence''"
I''m following the tutorial at the link below, but I cannot get it to work. If I set the RootKey to HKEY_CLASSES_ROOT then I can execute this code. But otherwise, no.
http://www.onlineprogrammer.org/articles/Articlea2-5-3.html