To create a GUID (Globally Unique Identifier) at runtime I have two different ways of doing this.
Add ComObj unit to the uses clause, if not already there, then to create the GUID as a string just do the following:
FThisID := CreateClassID;
This method you need the SysUtils in the uses clause. The do something like the following:
FThisID := GUIDToString(newGUID);