Article View: borland.public.cppbuilder.nativeapi
Article #7635Re: Registry in WinXP
From: Remy Lebeau (TeamB)
Date: Tue, 18 Jan 2005 10:21
Date: Tue, 18 Jan 2005 10:21
22 lines
1847 bytes
1847 bytes
"Grety" <valid@emailaddress.com> wrote in message
news:41ecdb87@newsgroups.borland.com...
> TRigistry *MyReg=new TRegistry();
> MyReg->RootKey=HKey_Local_Machine;
You are not taking into account that HKEY_LOCAL_MACHINE has security
privileges assigned to it. Not all users have access to modify the data
under that key. Usually administrator rights are required to do that.
Which version of BCB are you using? If BCB5 or BCB6, then TRegistry has an
Access property that you should be assigning to KEY_WRITE access before
opening the key. By default, the Access property is set to KEY_ALL_ACCESS,
which is restricted to admin users.
> MyReg->OpenKey("Software\\TheKey");
You are not checking to see whether OpenKey() succeeds or fails.
Gambit
Technical Details
Message-ID:
<41ece2bd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.esat.net!nntpfeed.zonnet.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41ecdb87@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,26d4cbfcdfdcb29b X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <41ecdb87@newsgroups.borland.com> Subject: Re: Registry in WinXP Date: Tue, 18 Jan 2005 02:21:53 -0800 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41ece2bd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106043581 68.69.17.41 (18 Jan 2005 02:19:41 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.esat.net!nntpfeed.zonnet.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail