If this is on Windows 95 then it'll probably be the same thing I was
grappling with on the list a month or so ago. 
Try adding a backslash to the end of the Key:
'\SOFTWARE\Namadgi Systems\Cricket\'
Instead of:
'\SOFTWARE\Namadgi Systems\Cricket'

========================================================
 Luke Pascoe                          Delphi Programmer
             enSynergy Consulting LTD

 [EMAIL PROTECTED]  +64-9-3551593  fax +64-9-3551590
 Level 4,   10-12 Federal St,   Auckland,   New Zealand
 PO Box 32521,  Devonport,  Auckland 1330,  New Zealand
========================================================

-----Original Message-----
From: Donovan J. Edye [mailto:[EMAIL PROTECTED]]
Sent: Friday, 10 August 2001 6:42 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Registry....


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. 
----------------------------------------------------------------------
---------------------------------------------------------------------------
    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/

Reply via email to