Delphi and Lazarus Registry Funtion GetValueNames not working properly
Hi,
I need a little help with this problem I cant figure out.
I made a program to read all comm ports from windows registry.
Under Delphi the first letter of value name is missing for every entry
fed back by GetValueNames.
Under Lazarus there is no result returned for the same code.
I would appreciate some help on this
Here is my source listing:
procedure TForm1.Button1Click(Sender: TObject);
var
r : TRegistry;
Names, Values: TStringList;
i : Integer;
s : string;
Tp: TRegDataType;
begin
try
s:='';
r:=TRegistry.Create;
Names:=TStringList.Create;
Values:=TStringList.Create;
with r do
begin
RootKey:=HKEY_LOCAL_MACHINE;
OpenKey('HARDWARE\DEVICEMAP\SERIALCOMM',False);
GetValueNames(Names);
for i:= 0 to Names.Count-1 do
begin
s:=s + Names.ValueFromIndex[i] + sLineBreak;
end;//for
CloseKey;
end;//with
showmessage(s);
finally
Names.Free;
values.Free;
r.Free;
end;//try
end;//procedure
|