I need some code to generate UUIDs for Delphi. Any recommendations?
+14
A:
program Guid;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
Uid: TGuid;
Result: HResult;
begin
Result := CreateGuid(Uid);
if Result = S_OK then
WriteLn(GuidToString(Uid));
end.
Under the covers CreateGuid()
calls the Windows API function CoCreateGuid().
Mitch Wheat
2010-02-20 01:51:16
+6
A:
Also, if you need a GUID for an interface declaration, hit ctrl+shift+g in the code editor to insert a GUID at the caret.
Nat
2010-02-20 09:59:30