Article View: borland.public.cppbuilder.nativeapi
Article #9443Re: What is the best location to Reg->CloseKey();
From: Remy Lebeau (TeamB)
Date: Wed, 07 Jul 2004 18:43
Date: Wed, 07 Jul 2004 18:43
22 lines
1540 bytes
1540 bytes
"Edward" <Registrados2004@aol.com> wrote in message
news:40ec37be@newsgroups.borland.com...
> if(Reg->OpenKey("\\Software\\Microsoft\\DirectX", false))
> {
> if(Reg->KeyExists("\\Software\\Microsoft\\DirectX"))
It is useless to call KeyExists() in this case. If OpenKey() succeeds, you
already know the key exists because it is already opened and active.
> 2 is the answer?:
You should be doing this instead:
if (Reg->OpenKey("\\Software\\Microsoft\\DirectX", false) )
{
Reg->CloseKey();
}
Gambit
Technical Details
Message-ID:
<40ec444a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40c86e9e@newsgroups.borland.com> <40eb41eb$1@newsgroups.borland.com> <40eb8d7b$1@newsgroups.borland.com> <40ec37be@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e3066f787953dff9 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40c86e9e@newsgroups.borland.com> <40eb41eb$1@newsgroups.borland.com> <40eb8d7b$1@newsgroups.borland.com> <40ec37be@newsgroups.borland.com> Subject: Re: What is the best location to Reg->CloseKey(); Date: Wed, 7 Jul 2004 11:43:48 -0700 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.10 Message-ID: <40ec444a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089225802 68.69.17.10 (7 Jul 2004 11:43:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail