Delphi Error – E2232 Interface ‘%s’ has no interface identification

Delphi Compiler Error

E2232 Interface ‘%s’ has no interface identification

Reason for the Error & Solution

You have attempted to assign an interface to a GUID type, but the interface was not defined with a GUID.

program Produce;

  type
    IBase = interface
    end;

  var
    g : TGUID;

  procedure p(x : TGUID);
  begin
  end;

begin
  g := IBase;
  p(IBase);
end.

In this example, the IBase type is defined but it is not given an interface, and is thus cannot be assigned to a GUID type.

program Solve;

  type
    IBase = interface
    ['{00000000-0000-0000-0000-000000000000}']
    end;

  var
    g : TGUID;

  procedure p(x : TGUID);
  begin
  end;

begin
  g := IBase;
  p(IBase);
end.

To solve the problem, you must either not attempt to assign an interface type without a GUID to a GUID type, or you must assign a GUID to the interface when it is defined. In this solution, a GUID has been assigned to the interface type when it is defined.

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...