The following code writes a new value to the specified key (I can see it with reg edit) but The_Registy.ReadString('AppGUID'); always returns an empty string even though there is a value in the key. Anybody got any clues? TIA
//Now do the GUID from the registry
The_Registy := TRegistry.Create;
The_Registy.RootKey := HKEY_LOCAL_MACHINE;
if The_Registy.OpenKey('\SOFTWARE\Namadgi Systems\Cricket', False) then
begin
The_Settings.AppGUID := The_Registy.ReadString('AppGUID');
if Trim(The_Settings.AppGUID) = '' then
begin
//We do not have a GUID so create one
OleCheck(CoCreateGUID(AGUID));
The_Settings.AppGUID := GUIDToString(AGUID);
//Should we have created it then write it back to the registry
//as it was not there in the first place
The_Registy.WriteString('AppGUID', The_Settings.AppGUID);
end;
The_Registy.CloseKey;
finally
FreeAndNil(The_Registy);
end;
----------------------------------------------------------------------
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems [www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
----------------------------------------------------------------------
GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
----------------------------------------------------------------------