unit GuidToString;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: GuidToString
// Routine: SysUtils.GUIDToString
// Routine: ComObj.OleCheck

// BeginCode
{
The following example manufactures a GUID and displays it in
a dialog box after translating it to a string.
} 
uses ActiveX, ComObj;
procedure TForm1.Button1Click(Sender: TObject);
var
  G: TGUID;
begin
  OleCheck(CoCreateGuid(G));
  ShowMessage(SysUtils.GUIDToString(G));
end;
// EndCode
// EndExample: GuidToString
end.
