我有父类TPerDevice,它有虚拟abstarct方法“doAction”,子类TPerPrnDevice覆盖“doAction” 有没有人知道我为什么得到abstarct异常? 谢谢 "Abstract Error'
type
TPerDevice = class(TThread)
public
function doAction(oPrm:String):String; virtual; abstract;
end;
type
TPerPrnDevice = class(TPerDevice)
public
//function doAction(oPrm:String):String;
end;
type
TxchPrn = class(TPerPrnDevice)
function doAction(oPrm:String):String;override;
procedure doLocalJob(oPrm:String);
end;
...
function TxchPrn.doAction(oPrm: String): String;
begin
doLocalJob(oPrm);
end;
procedure TForm1.Button1Click(Sender: TObject);
VAR Devices: array of TPerDevice;
begin
SetLength(Devices,2);
Devices[0]:=TxchPrn.Create;
Devices[0].doAction('Print');
end;
procedure TxchPrn.doLocalJob(oPrm: String);
begin
ShowMessage(oPrm);
end;