unit Unit1;<br><br>interface<br><br>uses<br> windows, messages, sysutils, variants, classes, graphics, controls, forms,<br> dialogs, activex, stdctrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> I : Integer;<br> sGUID : string;<br> TmpGUID: TGUID;<br>begin<br> for I := 0 to 10 do<br> begin<br> if CoCreateGUID(TmpGUID) = S_OK then<br> sGUID := GUIDToString(TmpGUID)<br> else<br> ShowMessage('Create GUID error!');<br> ShowMessage(sGUID);<br> end;<br>end;<br><br>end.