GUID - globally unique identifier

Globally unique identifiers (or universally unique identifiers) are used to identify COM interfaces, coclasses, type libraries, etc. It is like a name that is globally unique. A GUID can be stored as a variable of type GUID, or as string like {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}, where X are hexadecimal digits 0 to F. In programming, GUID sometimes is called differently: IID for interfaces, CLSID for classes, REFIID, etc.


Use uuidof to get pointer to GUID of a COM interface or coclass, or to convert GUID string to variable. To convert variable to string, use function str.FromGUID. To create new GUID, use str.Guid or CoCreateGuid.


In QM 2.4.0 and later, QM items also have GUID. QM can find items by name or GUID string. It is supported in QM command line, qmitem and other functions. The GUID string can be followed by any text; the text is ignored. Example: int iid=qmitem("{a138af76-23b1-4ef8-a4e1-7f459f948dbd}Macro1"). QM item GUID cannot be changed.


Why to use QM item GUID instead of name, for example in a command line? The main reason - the command line with GUID will still work after renaming the QM item. If using just name, after renaming also would need to edit the command line.


QM items that are in different QM files but have the same name usually have different GUID. They can have the same GUID only in copied files.