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.