delphi - Delphi IDE 中的 "incompatible parameter list"消息是否有解决方法?

标签 delphi ide delphi-2009 ambiguity

请考虑这个简化的示例:

type
  TForm43 = class(TForm)
    drwgrd1: TDrawGrid;
    procedure drwgrd1DrawCell(Sender: TObject; ACol, ARow: Integer; 
      Rect: Windows.TRect; State: TGridDrawState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

procedure TForm43.drwgrd1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: Windows.TRect; State: TGridDrawState);
begin
  Rect.Left := 5;
end;

在方法 drwgrd1DrawCell 中,我明确使用 Windows.TRect 来解决在两个不同单元中定义的 TRect 之间的歧义。一切正常,代码正在编译。 但是每次当我保存上述单元时,我都会从 Delphi IDE 收到一个问题,询问:“drwgrd1.OnDrawCell 引用的 drwgrd1DrawCell 方法有一个不兼容的参数列表。删除引用?

这很烦人。有什么方法可以关闭此消息对话框或以不显示该消息的方式编写我的代码吗?不幸的是,我无法将我的 TRect 更改为 TRect2 或类似的东西。

最佳答案

您可以在表单声明上方添加以下类型声明:

    type
      TRect = Windows.TRect;

关于delphi - Delphi IDE 中的 "incompatible parameter list"消息是否有解决方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12624306/

相关文章:

Delphi cxtreelist循环遍历节点

c# - 在 C# 代码中使用具有字符串 [255] 类型和结构的 Delphi DLL

delphi - 如何在流中搜索十六进制?

SQL 通过 ADO 在 Delphi 中返回值

c++ - 调试 C++ 语言服务器错误 : Invalid AST

delphi - 如何在 PostBuild 事件上并行执行程序?

Javascript IDE 可以在 js 代码中定位方法或属性的父对象?

java - 使用 jedit 作为 IDE

delphi - 在 Delphi 2009 上的 Rave Reports 中显示 unicode 文本

mysql - Delphi 2009、MyDAC 和关系数据库