Article View: borland.public.cppbuilder.nativeapi
Article #8913Re: Using TRegIniFile to read REG_DWORD type
From: Jermey
Date: Thu, 02 Sep 2004 21:19
Date: Thu, 02 Sep 2004 21:19
43 lines
2198 bytes
2198 bytes
Thanks Remy,
This is my code:
std::auto_ptr<TRegIniFile> registry(new TRegIniFile("MyApplication"));
registry->RootKey = HKEY_LOCAL_MACHINE;
int value =
registry->ReadInteger("SYSTEM\\CurrentControlSet\\Services\\XXXXXX\\Enum",
"Count", 0);
I verify that Count is REG_DWORD by using regedit.
I got this message:
raised exception class ERegistryException with message "Invalid data
type for "Count".
Jeremy
>Remy Lebeau (TeamB) wrote:
> "Jermey" <jasonssxxx@hotmail.com> wrote in message
> news:41376ce0$1@newsgroups.borland.com...
>
>
>> I am having a problem to read REG_DWORD type
>>from the registry with TRegIniFile.
>
>
> Please provide more details.
>
>
>>I have tried to use ReadInteger and ReadString. The
>>system always gave me an exception saying wrong data type.
>
>
> ReadInteger() is the correct way to read REG_DWORD values. The only way
> ReadInteger() could produce such as error is if the Registry value is not a
> REG_DWORD to begin with.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<41378d59@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!border2.nntp.ams.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41376ce0$1@newsgroups.borland.com> <413777c5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,29fe9a1bf7a007b8 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 02 Sep 2004 14:19:42 -0700 From: Jermey <jasonssxxx@hotmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Using TRegIniFile to read REG_DWORD type References: <41376ce0$1@newsgroups.borland.com> <413777c5$1@newsgroups.borland.com> In-Reply-To: <413777c5$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.127.61.146 Message-ID: <41378d59@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094159705 67.127.61.146 (2 Sep 2004 14:15:05 -0700) Lines: 43 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!border2.nntp.ams.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail