S
sw7309
Unregistered / Unconfirmed
GUEST, unregistred user!
TY = CLASS
PRIVATE
PUBLIC
CONSTRUCTOR Create
VIRTUAL
ABSTRACT;
FUNCTION bLoadFromFile(sFile: STRING): Boolean
VIRTUAL
ABSTRACT
//从文件导入,成功返回True,失败返回False
PROCEDURE Show(Canvas: TCanvas)
VIRTUAL
ABSTRACT
//在Canvas上显示
END;
TQhY = CLASS(TYk)
PRIVATE
PUBLIC
FUNCTION bLoadFromFile(sFile: STRING): boolean
OVERRIDE;
PROCEDURE Show(Canvas: TCanvas)
OVERRIDE
//在Canvas上显示
CONSTRUCTOR Create
OVERRIDE;
DESTRUCTOR Free;
END;
procedure KKK;
VAR Y : TY;
begin
Y := TQhY.Create;
IF Y.bLoadFromFile('c:/a.img') THEN
Y.Show(image1.Canvas);//*****出错***********
end;
请问,上述代码为什么会在有*号的一行出错?
PRIVATE
PUBLIC
CONSTRUCTOR Create
VIRTUAL
ABSTRACT;
FUNCTION bLoadFromFile(sFile: STRING): Boolean
VIRTUAL
ABSTRACT
//从文件导入,成功返回True,失败返回False
PROCEDURE Show(Canvas: TCanvas)
VIRTUAL
ABSTRACT
//在Canvas上显示
END;
TQhY = CLASS(TYk)
PRIVATE
PUBLIC
FUNCTION bLoadFromFile(sFile: STRING): boolean
OVERRIDE;
PROCEDURE Show(Canvas: TCanvas)
OVERRIDE
//在Canvas上显示
CONSTRUCTOR Create
OVERRIDE;
DESTRUCTOR Free;
END;
procedure KKK;
VAR Y : TY;
begin
Y := TQhY.Create;
IF Y.bLoadFromFile('c:/a.img') THEN
Y.Show(image1.Canvas);//*****出错***********
end;
请问,上述代码为什么会在有*号的一行出错?