March 2000
Intermediate to advanced
576 pages
18h 13m
English
TGUID Type
type
TGUID = packed record
D1: LongWord;
D2: Word;
D3: Word;
D4: array[0..7] of Byte;
end;The TGUID type stores a Globally Unique Identifier
(GUID). When Windows generates a new GUID, it guarantees that the
GUID is unique among all the GUIDs generated throughout the world.
Delphi uses GUIDs to identify and look up
interfaces.
Delphi automatically casts an interface name to its GUID, so you can
use the interface name in calls to QueryInterface,
for example.
In an interface declaration, write a GUID in square brackets, e.g.:
type IUnknown = interface
['{00000000-0000-0000-C000-000000000046}']To generate a new GUID in the IDE, press Ctrl-Shift-G.
GUIDs are optional in interface declarations, but you usually need them. Without a GUID, you cannot cast an interface to another type.
| Interface Keyword, IUnknown Interface, PGUID Type |
Read now
Unlock full access