Just look up Delphi Help for CreateGuid - no need to search the net.

Mike


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of petesouthwest
Sent: Thursday, 26 May 2005 5:39 PM
To: [email protected]
Subject: [delphi-en] Re: Generating keys in the registry? GUIDs?

Hi

I have not heard of GUIDs, but looking on the net found the code 
below. Is it ok just to use the result?

Thanks
Pete 

uses
  ComObj, ActiveX;

function CreateGuid: string;
var
  ID: TGUID;
begin
  Result := '';
  if CoCreateGuid(ID) = S_OK then
    Result := GUIDToString(ID);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.Text := CreateGuid;
  // or: Edit1.Text := CreateClassID
end;
 

> Our app generated 4 GUIDs that are used in the
> registry, with some different keys under them. If you
> generate a GUID, you're fairly sure the chance of
> collision is small (not zero, but small).  

> Warrick
> 
> 
>               
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Small Business - Try our new Resources site
> http://smallbusiness.yahoo.com/resources/




-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links



 





-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to