🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13863

Re: what's wrong with this code?

#13863
From: FrankW
Date: Sun, 14 Sep 2003 04:01
63 lines
2624 bytes
Hi Remy,

I tried following code, it works:

  TRegistry *Reg = new TRegistry;
  try
  {
    Reg->RootKey = HKEY_CURRENT_USER;
    if (Reg->OpenKey("\\Software\\Microsoft\\Internet Explorer", true))
    {
      ShowMessage("yes");
    }
  }
  __finally
  {
    Reg->CloseKey();
    delete Reg;
  }

but this fail:

 lResult = RegOpenKeyEx( HKEY_CURRENT_USER,
        "\\Software\\Microsoft\\Internet Explorer", 0, KEY_READ,
&hKeyResult);

They are in the same program, I can't use TRegistry approach as i need to
access the registry before Application->Initialize();

anything I miss here?

Thanks,

Frank




"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3f63e3c0$1@newsgroups.borland.com...
>
> "FrankW" <nospam@nospam.com> wrote in message
> news:3f63e14b@newsgroups.borland.com...
>
> > yes, the key exists, in fact I use RegEdit's Copy Key Name
> > option to copy it to the code, it really confuses me. here is
> > another code that can be tested in any computer with IE installed
>
> I don't know what to tell you.  There is absolutely nothing wrong with the
> code you have posted, so I have to suspect that either 1) the keys really
do
> not exist, or else 2) you altered your user rights to those keys and thus
> can't access them anymore until you reset the rights using REGEDIT32.
>
>
> Gambit
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
>
>
Technical Details
Message-ID: <3f63e876$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f63ddac@newsgroups.borland.com> <3f63df78$1@newsgroups.borland.com> <3f63e14b@newsgroups.borland.com> <3f63e3c0$1@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:06:38 PST
Reply-To: "FrankW" <nospam@nospam.com>
From: "FrankW" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f63ddac@newsgroups.borland.com> <3f63df78$1@newsgroups.borland.com> <3f63e14b@newsgroups.borland.com> <3f63e3c0$1@newsgroups.borland.com>
Subject: Re: what's wrong with this code?
Date: Sun, 14 Sep 2003 12:01:50 +0800
Lines: 65
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: <3f63e876$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1063512182 203.131.162.116 (13 Sep 2003 21:03:02 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail