Article View: borland.public.cppbuilder.nativeapi
Article #13866Re: what's wrong with this code?
From: Remy Lebeau (TeamB)
Date: Sun, 14 Sep 2003 04:40
Date: Sun, 14 Sep 2003 04:40
38 lines
2383 bytes
2383 bytes
"FrankW" <nospam@nospam.com> wrote in message news:3f63e876$1@newsgroups.borland.com... > I tried following code, it works: <snip> > but this fail: The *only* differences between the two as far as the API is concerned is that: 1) TRegistry always strips off the leading "\\" when calling the API functions 2) you are setting the CanCreate parameter of TRegistry::OpenKey() to true, so RegCreateKeyEx() will be called instead of RegOpenKeyEx(). If the key does not actually exist, then it will be created and OpenKey() will still succeed. That leads back to my earlier statements about RegOpenKeyEx() failing due to the key really not existing to begin with. RegOpenKeyEx() would fail where RegCreateKeyEx() would not (barring user rights, of course).. > I can't use TRegistry approach as i need to access > the registry before Application->Initialize(); Of course you can use TRegistry before Application->Initialize(). TRegistry has no dependancies on TApplication at all. Simply modify the project's WinMain() function directly if you want to do anything before initializing TApplication. 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:
<3f63f0fd$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-mailReferences:
<3f63ddac@newsgroups.borland.com> <3f63df78$1@newsgroups.borland.com> <3f63e14b@newsgroups.borland.com> <3f63e3c0$1@newsgroups.borland.com> <3f63e876$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:41:30 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.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> <3f63e876$1@newsgroups.borland.com> Subject: Re: what's wrong with this code? Date: Sat, 13 Sep 2003 21:40:13 -0700 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f63f0fd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1063514365 207.175.226.26 (13 Sep 2003 21:39:25 -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