getInterface

getInterface(interface: Class): IDispatch;

The getInterface method of the ActiveXAutomation class returns the ActiveX interface specified in the interface parameter, if it exists. (As ActiveX interfaces are created as subclasses of the IDispatch class when an ActiveX type library is imported, use the Class List of the Class Browser to obtain the names of ActiveX interfaces, if required.) If the specified interface does not exist, a null value is returned.

The following example shows the use of the getInterface method.

displayInterfaceName();
vars
    font      : JadeAutoFont;
    interface : IDispatch;
begin
    create font;
    font.bold := true;
    interface := font.getInterface(IJadeAutoFont);
    write interface.getName;                      // Outputs IJadeAutoFont
epilog
    delete font;
end;