帮我看看是什么错误~!!?(20分)

  • 主题发起人 主题发起人 doglive
  • 开始时间 开始时间
D

doglive

Unregistered / Unconfirmed
GUEST, unregistred user!
unit formmaker;

interface

uses
SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs;

type
IButton = interface(IInterface)
['{90013C12-3F95-4419-816A-5AA03AF279E9}']
end;
IPanel = interface(IUnknown)
['{5F0F0345-32B2-4C6A-BE15-01D60CE8628D}']
end;
TStandardPanel = class(TObject, IPanel)
end;

TArtPanel = class(TObject, IPanel)
end;



TFormMaker = class(TObject)
end;


implementation



end.
编译出现
[Error] formmaker.pas(17): Undeclared identifier: 'QueryInterface'
[Error] formmaker.pas(17): Undeclared identifier: '_AddRef'
[Error] formmaker.pas(17): Undeclared identifier: '_Release'
[Fatal Error] abstractFactory.dpr(6): Could not compile used unit 'formmaker.pas'
 
TArtPanel = class(TInterfacedObject, IPanel)
 
实现接口的类,必须实现IInterface的'QueryInterface','_AddRef','_Release'三个方法.
当然为了节少点时间,你可以继承已经实现了这些方法的类,如TInterfacedObject,TComponent
 
后退
顶部