0

I'm trying to port a project from Delphi 7 to the new Delphi XE4 and I'm facing a problem with the move function :

{Create a temp record buffer}
HoldRec := AllocMem(RecordSize);
{Fill the temp record buffer with the current record}
move(ActiveBuffer^, HoldRec^, RecordSize); //Here the E2017 Error

The compiler throw an : [dcc32 Error] E2017 Pointer type required , error when arrive at the move statement ...

Why ? In Delphi 7 it compile without any problem, why Delphi XE4 doesn't compile ?

The declaration section is as follows :

FBuffers: TBufList;
HoldRec : PChar;
FActiveRecord :integer;


function TDataSet.ActiveBuffer: TRecBuf;
begin
  Result := FBuffers[FActiveRecord];
end;
4

1 回答 1

3

在 Delphi 7 中,TRecBuf 是某种类型的指针,我不确定到底是什么。在 XE4 中,它被声明为 NativeInt。您需要将其转换为使代码编译的指针。

move(Pointer(ActiveBuffer)^, HoldRec^, RecordSize); 

我还要指出,HoldRec 现在是 Unicode XE4 中的 PWideChar,但它是 Delphi 7 中的 PAnsiChar。我怀疑您需要以一种或另一种方式处理。很可能您需要将声明更改为 PAnsiChar,但我不能从这里确定。

于 2013-07-21T09:52:14.220 回答