On Wed, 14 Jun 2006, Andreas Berger wrote:
I have a routine that I have been using for years in Delphi to read the
registry. However, it does not work with Lazarus. I looked at the Lazarus
sources and examples and it seems that Lazarus uses it the same as Delphi.
Can someone please tell me what I need to change? The routine is:
function ReadRegistry(RegKey, Key : string; var Value : String) : boolean;
var
Reg : TRegistry;
begin
Result := false;
Reg := TRegistry.Create;
try
with Reg do
begin
RootKey := HKEY_CURRENT_USER;
if OpenKey(RegKey, false) and ValueExists(Key)
then begin
Value := ReadString(Key);
Result := true;
end;
end;
finally
Reg.Free;
end;
end;
If I remember correctly, there is a bug in the TRegistry class in the
official 2.0.2 release of FPC. This bug is meanwhile fixed, but is not
in the Lazarus 0.9.16 release. For that you need to compile Lazarus
and FPC from the latest sources.
Michael.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives