Forward Declarations
An interface declaration that ends with the reserved word interface and a semicolon, without specifying an ancestor,
GUID, or member list, is a forward declaration. A forward declaration must be resolved by a defining declaration of
the same interface within the same type declaration section. In other words, between a forward declaration and its
defining declaration, nothing can occur except other type declarations.
Forward declarations allow mutually dependent interfaces. For example,
type
IControl = interface;
IWindow = interface
['{00000115-0000-0000-C000-000000000044}']
function GetControl(Index: Integer): IControl;
.
.
.
end;
IControl = interface
['{00000115-0000-0000-C000-000000000049}']
function GetWindow: IWindow;
.
.
.
end;
193
Mutually derived interfaces are not allowed. For example, it is not legal to derive
IWindow
from
IControl
and also
derive
IControl
from
IWindow
.
194
|