2
2843223
Unregistered / Unconfirmed
GUEST, unregistred user!
自己写了一个测试类<br> TCardMachine=class(TInterfacedObject,IMachine)<br> Public<br> constructor Create;<br> Destructor Destroy;<br> Procedure Free; virtual;abstract;<br> Function Read(var Rbuff:TDataBuff):Boolean ; virtual;abstract;<br>在子类中<br>TCardM1 =class(TCardMachine)<br> private<br> Function Connect :boolean;override;<br> procedure DisConnect; override;<br> Public<br> Constructor Create; OverLoad;<br> Destructor Destroy;overload;<br> Procedure Free ; override;<br> Function Read (var Rbuff:TDataBuff;<br> Password:string='ffffffffffff'):Boolean ; overload;<br><br>我在调用的过程中这么使用<br>var m1 :TCardMachine;<br>m1:=tcardm1.create;<br>m1.read 时 为什么出错 ,我知道 是因为TCardMachine.read是虚拟的,但是我用的是<br>子类 tcardm1创建的呀。<br>如果解决,请问怎么解决