Interfaces can also be ordered in a hierarchy, exactly as classes: An interface de nition that inherits from another interface de nition contains all the methods from the parent interface, as well as the methods explicitly named in the interface de nition. A class implementing an interface must then implement all members of the interface as well as the methods of the parent interface(s).
An interface can be uniquely identi ed by a GUID (GUID is an acronym for Globally Unique Identi er, a 128-bit integer guaranteed always to be unique1 . Especially on Windows systems, the GUID of an interface can and must be used when using COM.
The de nition of an Interface has the following form:
_________________________________________________________________________________________________________
Interface type
![-- --Interface -|--------|------------|---------------end------------
heritage- -['-GUID ']-- - component list-](ref91x.png)


___________________________________________________________________
Along with this de nition the following must be noted:
The following are examples of interfaces:
IUnknown = interface ['{00000000-0000-0000-C000-000000000046}']
function QueryInterface(const iid : tguid;out obj) : longint; function _AddRef : longint; function _Release : longint; end; IInterface = IUnknown; IMyInterface = Interface Function MyFunc : Integer; Function MySecondFunc : Integer; end; |
As can be seen, the GUID identifying the interface is optional.