作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
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/
type TCDSWithRecalc = class(TClientDataset) public procedure GetCalcFields(Buffer: PChar); o
我是一名优秀的程序员,十分优秀!