Show: Object Pascal C++
Display Preferences

E2228 A dispinterface type cannot have an ancestor interface (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

An interface type specified with dispinterface cannot specify an ancestor interface.


program Produce;

  type
    IBase = interface
    end;

    IExtend = dispinterface (IBase)
    ['{00000000-0000-0000-0000-000000000000}']

    end;

begin
end.

In the example above, the error is caused because IExtend attempts to specify an ancestor interface type.


program Solve;

  type
    IBase = interface
    end;

    IExtend = dispinterface
    ['{00000000-0000-0000-0000-000000000000}']

    end;

begin
end.

Generally there are two solutions when this error occurs: remove the ancestor interface declaration, or change the dispinterface into a regular interface type. In the example above, the former approach was taken.

Personal tools
In other languages