Article View: borland.public.cppbuilder.nativeapi
Article #9401Registry
From: gchang
Date: Fri, 09 Jul 2004 20:24
Date: Fri, 09 Jul 2004 20:24
24 lines
1650 bytes
1650 bytes
I am working on a program that enumerates the system registry.
Everything is working except certain keys. These keys always
return a null when read by the GetKeyNames() call, even the string count is NOT zero. The two keys I am having problem with are:
system\\controlset002\\control\\mediaResources\\JoyStick
system\\controlset002\\control\\mediaResources\\MIDI
The following is an example.
TRegistry *registry = new TRegistry;
registry->RootKey = HKEY_LOCAL_MACHINE;
TStringList *keys = new TStringList();
if( registry->OpenKey(KeyPath, false) ) {
if( registry->HasSubKeys() ) {
registry->GetKeyNames(keys);
registry->CloseKey();
Edit1->Text = keys->Strings[0];// keys->Strings[0]=NULL
Edit2->Text = IntToStr(keys->Count);// keys->count=1
}
}
What am I missing? Is there some global parameters I need to set first? Thanks!
Gene
Technical Details
Message-ID:
<40eefee4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4dc6bd9464f5b9c3,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "gchang" <gchang@ata-sd.com> Sender: "gchang" <gchang@ata-sd.com> Reply-To: "gchang" <gchang@ata-sd.com> Subject: Registry Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 63.202.158.131 NNTP-Posting-Host: 207.105.83.66 Message-ID: <40eefee4$1@newsgroups.borland.com> Date: 9 Jul 2004 13:24:04 -0700 X-Trace: newsgroups.borland.com 1089404644 207.105.83.66 (9 Jul 2004 13:24:04 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail