HomeDelphiDelphi Error – E2229 A dispinterface type requires an interface identification

Delphi Error – E2229 A dispinterface type requires an interface identification

Delphi Compiler Error

E2229 A dispinterface type requires an interface identification

Reason for the Error & Solution

When using dispinterface types, you must always be sure to include a GUID specification for them.

program Produce;

  type
    IBase = dispinterface
    end;

begin
end.

In the example shown here, the dispinterface type does not include a GUID specification, and thus causes the compiler to emit an error.

program Solve;

  type
    IBase = dispinterface
    ['{00000000-0000-0000-0000-000000000000}']

    end;

begin
end.

Ensuring that each dispinterface has a GUID associated with it will cause this error to go away.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...