Article View: borland.public.cppbuilder.nativeapi
Article #13864Re: what's wrong with this code?
From: FrankW
Date: Sun, 14 Sep 2003 04:20
Date: Sun, 14 Sep 2003 04:20
55 lines
2490 bytes
2490 bytes
Hi Remy,
I found the problem, the path should have been
Software\\Borland\\C++Builder\\4.0,
not \\Software\\Borland\\C++Builder\\4.0
however, TRegistry of Borland accepts both of them which cause this
confusion, thanks.
Frank
"FrankW" <nospam@nospam.com> wrote in message
news:3f63ddac@newsgroups.borland.com...
> Hi Remy,
>
> Thanks for the reply and sorry for the wrong news group I posted the
> question, I tried the KEY_READ right, i still get the same error 161:
>
> LONG lResult;
> HKEY hKeyResult = 0;
>
> lResult = RegOpenKeyEx( HKEY_CURRENT_USER,
> PChar("\\Software\\Borland\\C++Builder\\4.0"), 0, KEY_READ , &hKeyResult);
>
> //lResult is always 161, why?
>
> if (lResult == ERROR_SUCCESS)
> {
> }
>
> regards,
>
> Frank
>
>
>
> "Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
> news:3f63d9a7@newsgroups.borland.com...
> >
> > Under NT/2K/XP, KEY_ALL_ACCESS requires the calling user to have admin
> > rights. You should NEVER use KEY_ALL_ACCESS in your own code whenever
you
> > can avoid it.
> >
> > If you are only going to modify a key's contents, you should open the
key
> > with KEY_WRITE rights. Even better would be if you can design your code
> so
> > that you can specify KEY_CREATE_SUB_KEY and KEY_SET_VALUE separately.
> >
> > If you are only going to read from the key, you should open the key with
> > KEY_READ rights. Or better, if you can specify KEY_ENUMERATE_SUB_KEYS
and
> > KEY_QUERY_VALUE separately.
>
>
Technical Details
Message-ID:
<3f63ecd3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f63ddac@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,636b723329c7c5e8 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-13 21:26:17 PST Reply-To: "FrankW" <nospam@nospam.com> From: "FrankW" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f63ddac@newsgroups.borland.com> Subject: Re: what's wrong with this code? Date: Sun, 14 Sep 2003 12:20:27 +0800 Lines: 57 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 203.131.162.116 Message-ID: <3f63ecd3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1063513299 203.131.162.116 (13 Sep 2003 21:21:39 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail