Home project raised exception class abstract error with message "Abstract Error'
Reply: 1

project raised exception class abstract error with message "Abstract Error'

saeed yazdani
1#
saeed yazdani Published in 2017-09-11 16:37:36Z

I have parent class TPerDevice which has Virtual abstarct method "doAction" , and child class TPerPrnDevice which override "doAction" does any body know why is i got abstarct exception ? Thanks "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;
Victoria
2#
Victoria Reply to 2017-09-11 16:42:58Z

You forgot to implement thread execution method Execute.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.321531 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO