System.TGUID

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

  TGUID = record
    D1: Cardinal;
    D2: Word;
    D3: Word;
    D4: array[0..7] of Byte;
    class operator Equal(const Left, Right: TGUID): Boolean;
    class operator NotEqual(const Left, Right: TGUID): Boolean;
    class function Empty: TGUID; static;
    class function Create(const Data; BigEndian: Boolean = False): TGUID; overload; static;
    class function Create(const Data: array of Byte; AStartIndex: Cardinal; BigEndian: Boolean = False): TGUID; overload; static;
  end;

C++

typedef GUID                 TGUID;            //

Properties

Type Visibility Source Unit Parent
record
typedef
public
System.pas
sysmac.h
System System

Description

TGUID is a structured form of the value that uniquely identifies an interface.

An interface declaration can specify a globally unique identifier (GUID), represented by a string literal enclosed in brackets immediately preceding the memberList. The GUID part of the interface declaration must have the form:

['{GUID}']

or

['{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}']

where each x is a hexadecimal digit (0 through 9 or A through F). On Windows, the Type Library editor automatically generates GUIDs for new interfaces. You can also generate GUIDs by pressing CTRL+SHIFT+G in the Code editor.

TGUID provides structured access to GUID:

  • The first 8 hexadecimal digits map D1.
  • The next 4 hexadecimal digits map D2.
  • The next 4 hexadecimal digits map D3.
  • The next 4 hexadecimal digits map the first 2 bytes in D4.
  • The last 12 hexadecimal digits map the remaining 6 bytes in D4.

Code Examples

See Also