gpt4 book ai didi

class - 在基类错误中找不到“GetCalcFields”

转载 作者:行者123 更新时间:2023-12-05 04:38:07 26 4
gpt4 key购买 nike

type
TCDSWithRecalc = class(TClientDataset)
public
procedure GetCalcFields(Buffer: PChar); override;
end;

procedure TCDSWithRecalc.GetCalcFields(Buffer :PChar);
begin
inherited GetCalcFields(Buffer);
end;

E2137 在基类中找不到方法“GetCalcFields”。

我不明白这个错误是什么。你能帮忙吗?

最佳答案

您没有说您使用的是哪个 Delphi 版本,但是 Buffer 参数的类型声明已从原始(D7 及之前)的 PChar 更改为现代(Unicode)版本中的 TRecBuf。因此,您需要更改 TCDSWithRecalc 的声明

type
TCDSWithRecalc = class(TCustomClientDataset)
public
procedure GetCalcFields(Buffer: TRecBuf); override;
end;

[...]

procedure TCDSWithRecalc.GetCalcFields(Buffer : TRecBuf);
begin
inherited GetCalcFields(Buffer);
end;

在 Delphi 10.4.2 中,编译器会报告您的声明版本的附加错误

[dcc32 Error] cds1u.pas(41): E2250 There is no overloaded version of 'GetCalcFields' that can be called with these arguments

这是真的。

关于class - 在基类错误中找不到“GetCalcFields”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70643604/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com