RAD Studio (Common)
ContentsIndex
PreviousUpNext
Object Interfaces

This section describes the use of interfaces in Delphi.

Name 
Description 
An object interface, or simply interface, defines methods that can be implemented by a class. Interfaces are declared like classes, but cannot be directly instantiated and do not have their own method definitions. Rather, it is the responsibility of any class that supports an interface to provide implementations for the interface's methods. A variable of an interface type can reference an object whose class implements that interface; however, only methods declared in the interface can be called using such a variable.
Interfaces offer some of the advantages of multiple inheritance without the semantic difficulties. They are also essential for using... more 
Once an interface has been declared, it must be implemented in a class before it can be used. The interfaces implemented by a class are specified in the class's declaration, after the name of the class's ancestor.
 
If you declare a variable of an interface type, the variable can reference instances of any class that implements the interface. These topics describe Interface references and related topics. 
An object whose class implements the IDispatch interface (declared in the System unit) is an Automation object.
Use variants to access Automation objects. When a variant references an Automation object, you can call the object's methods and read or write to its properties through the variant. To do this, you must include ComObj in the uses clause of one of your units or your program or library. 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!