[英]Incompatible types: 'PPointerList' and 'TPointerList' in Delphi XE4
我收到错误Incompatible types: 'PPointerList' and 'TPointerList'
以下函数中为Incompatible types: 'PPointerList' and 'TPointerList'
。
function MyFunction: PPointerList;
begin
result := FList.List;
end;
FList.List返回TPointerList类型。 该代码在Delphi 7代码中工作正常,但在Delphi XE4中引发错误。
PPointerList和TPointerList在System.Classes中声明
在System.Classes中
PPointerList = ^TPointerList;
TPointerList = array of Pointer;
当我将TPointerList广播到PPointerList时,它的工作方式就像
function MyFunction: PPointerList;
begin
result := PPointerList(FList.List);
end;
是正确的解决方案,还是该怎么做才能消除此错误。
TList
已更改。 内部字段FList
曾经是PPointerList
但现在是TPointerList
。 要返回指向它的指针,可以使用以下命令:
function MyFunction: PPointerList;
begin
Result := @FList.List;
end;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.