我对Delphi和总体开发还是有些陌生,对于64位开发则真的很陌生。我有来自XE2的32位Delphi App的以下代码,我试图在10.3.3中以64位进行编译。我收到一个无效的Typecast错误,无法找出解决方法。
procedure TSetupDialog.pPkgMethodDefaultSelected;
Var
ParmNo: integer;
Choice: PtrRec;
begin
{Making sure the user selected an actual item.}
if lbPkgDefault.Itemindex > -1 then
begin
Choice := PtrRec(lbPkgDefault.Items.Objects[lbPkgDefault.Itemindex]);{ read object value}<<<<Error
{ don't accept the click if item is disabled }
if Choice.Hi = 1 then begin {item is disabled}
messagebeep(0);
exit;
end;
{ put the selected parm's choiceNo = Choice.Lo in the Dealer table }
Quote.pSetPackageUserDefault(Choice.Lo);
end;
end;
我该如何解决?
编辑:
type
PtrRec = record { used for typecasting Stringlist objects,i.e. pointers }
Lo: smallInt; { 16 bits }
Hi: smallInt; { 16 bits }
end;