Delphi IDE中遇到不兼容参数列表消息,如何彻底排查并修复?

2026-04-10 01:572阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计284个文字,预计阅读时间需要2分钟。

Delphi IDE中遇到不兼容参数列表消息,如何彻底排查并修复?

请考虑以下简化示例:

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

请考虑这个简化的例子:

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之间的歧义.一切正常,代码正在编译.
但每次当我保存上述单位我收到来自德尔福IDE这问了一个问题:“通过drwgrd1.OnDrawCell引用的drwgrd1DrawCell方法有一个不兼容的参数列表中删除引用.?”

这非常烦人.有没有办法关闭此消息对话框或以不会显示的方式编写我的代码?不幸的是我不能改变TRect2的TRect或类似的东西.

Delphi IDE中遇到不兼容参数列表消息,如何彻底排查并修复?

保存表单时出现错误的原因是因为Delphi比较了所有事件处理程序的声明,以确保它们的声明与它们的继承实现完全相同.添加Windows.声明使比较失败.

您可以删除Windows.如果您在声明TRect的uses子句中的另一个单元之后移动Windows单元,则从drwgd1DrawCell()开始.这是因为Delphi从最后一个到第一个处理uses子句中的单元.它将使用它发现的第一个实例的TRect …

标签:参数

本文共计284个文字,预计阅读时间需要2分钟。

Delphi IDE中遇到不兼容参数列表消息,如何彻底排查并修复?

请考虑以下简化示例:

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

请考虑这个简化的例子:

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之间的歧义.一切正常,代码正在编译.
但每次当我保存上述单位我收到来自德尔福IDE这问了一个问题:“通过drwgrd1.OnDrawCell引用的drwgrd1DrawCell方法有一个不兼容的参数列表中删除引用.?”

这非常烦人.有没有办法关闭此消息对话框或以不会显示的方式编写我的代码?不幸的是我不能改变TRect2的TRect或类似的东西.

Delphi IDE中遇到不兼容参数列表消息,如何彻底排查并修复?

保存表单时出现错误的原因是因为Delphi比较了所有事件处理程序的声明,以确保它们的声明与它们的继承实现完全相同.添加Windows.声明使比较失败.

您可以删除Windows.如果您在声明TRect的uses子句中的另一个单元之后移动Windows单元,则从drwgd1DrawCell()开始.这是因为Delphi从最后一个到第一个处理uses子句中的单元.它将使用它发现的第一个实例的TRect …

标签:参数