Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

soconne

Registry Access Error

This topic is 5283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Are you certain you have local machine permissions? I''m not sure what the correct venue for setting permissions is in Borland, but I know that when I''m doing auto shutdowns on my stuff I have to set local machine permissions prior to attempting shutdown or it won''t listen to me.

-fel

Share this post


Link to post
Share on other sites
Well I am logged into my computer as Administrator in WinXP. How do you go about setting permissions? I''m sure I can convert it over to Borland.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!