Hi Donovan,
I think you may find it's because of the '\' character before SOFTWARE
in the OpenKey call.
Regards,
Bevan
"Donovan J. Edye" wrote:
>
> G'Day,
>
> 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
> ----------------------------------------------------------------------
>
> 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.
> ----------------------------------------------------------------------
--
Bevan Edwards mailto:[EMAIL PROTECTED]
Achieve Software Limited http://www.achieve.co.nz
Phone: (64-9) 444-4210 ICQ: 732011
Fax: (64-9) 444-4201
Mobile: (64-21) 979-603
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/