Delphi Error – E2230 Methods of dispinterface types cannot specify directives

Delphi Compiler Error

E2230 Methods of dispinterface types cannot specify directives

Reason for the Error & Solution

Methods declared in a dispinterface type cannot specify any calling convention directives.

program Produce;

  type
    IBase = dispinterface
    ['{00000000-0000-0000-0000-000000000000}']
      procedure yamadama; register;
    end;

begin
end.

The error in the example shown here is that the method ‘yamadama’ attempts to specify the register calling convention.

program Solve;

  type
    IBase = dispinterface
    ['{00000000-0000-0000-0000-000000000000}']
      procedure yamadama;
    end;

begin
end.

Since no dispinterface method can specify calling convention directives, the only solution to this problem is to remove the offending directive, as shown in this example.

Share:

Leave A Reply

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

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...