Board index » delphi » Using TRegistry.GetKeyNames

Using TRegistry.GetKeyNames

Hi,

I am trying to use GetKeyNames but I get an abstract error when I do that :

const
   ROOT_KEY = HKEY_LOCAL_MACHINE;
   KEY = '\SOFTWARE\ABC\DATABASE';
var
   Reg : TRegistry;
   server, base : TStrings;

begin
   server := TStrings.Create;
   Reg := TRegistry.Create;
   try
    Reg.RootKey := ROOT_KEY;
    if Reg.OpenKey(KEY, True) then
              Reg.GetKeyNames( server ); // abstract error here
   finally
    Reg.CloseKey;
    Reg.Free;
    server.Free;
   end;

If someone can help me...
Thank-you all.

Denis.

 

Re:Using TRegistry.GetKeyNames


You must use a TStringList rather than a TStrings...

Dan

On Wed, 31 May 2000 18:38:51 +0200, "one" <d.cre...@abc-arbitrage.com>
wrote:

Quote
>Hi,

>I am trying to use GetKeyNames but I get an abstract error when I do that :

>const
>   ROOT_KEY = HKEY_LOCAL_MACHINE;
>   KEY = '\SOFTWARE\ABC\DATABASE';
>var
>   Reg : TRegistry;
>   server, base : TStrings;

>begin
>   server := TStrings.Create;
>   Reg := TRegistry.Create;
>   try
>    Reg.RootKey := ROOT_KEY;
>    if Reg.OpenKey(KEY, True) then
>              Reg.GetKeyNames( server ); // abstract error here
>   finally
>    Reg.CloseKey;
>    Reg.Free;
>    server.Free;
>   end;

>If someone can help me...
>Thank-you all.

>Denis.

Other Threads