在delphi程序中创建一个鼠标事件类,为何该事件类的实例数量不能超过两个?谢(200分)

  • 主题发起人 主题发起人 ImageEn
  • 开始时间 开始时间
I

ImageEn

Unregistered / Unconfirmed
GUEST, unregistred user!
type

TObjectProcedure = procedure of object;

TEventObject = class(TInterfacedObject, IDispatch)
private
FOnEvent: TObjectProcedure;
protected
function GetTypeInfoCount(out Count: Integer): HResult
stdcall;
function GetTypeInfo(Index, LocaleID: Integer
out TypeInfo): HResult
stdcall;
function GetIDsOfNames(const IID: TGUID
Names: Pointer
NameCount, LocaleID: Integer
DispIDs: Pointer): HResult
stdcall;
function Invoke(DispID: Integer
const IID: TGUID
LocaleID: Integer
Flags: Word
var Params
VarResult, ExcepInfo, ArgErr: Pointer): HResult
stdcall;
public
constructor Create(const OnEvent: TObjectProcedure);
property OnEvent: TObjectProcedure read FOnEvent write FOnEvent;
end;


TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject
var Action: TCloseAction);
procedure FormCreate(Sender: TObject);

private
procedure Document_OnMouseOver;
procedure Document_OnMouseOver0;
procedure Document_OnMouseOver1;//提示错误:Unsatisfied forward or external declaration: 'Tform1.Document_OnMouseOver1'
public

end;


在delphi程序中创建一个鼠标事件类,为何该事件类的实例数量不能超过两个?当创建第3个实例procedure Document_OnMouseOver1时提示错误Unsatisfied forward or external declaration: 'Tform1.Document_OnMouseOver1'
,为什么?怎么办呢?谢了
 
procedure Document_OnMouseOver;
procedure Document_OnMouseOver0;
procedure Document_OnMouseOver1;//提示错误:Unsatisfied forward or external declaration: 'Tform1.Document_OnMouseOver1'

这位楼主,你这个错误和你理解的不是一回事。看来你是刚刚用Delphi,
这个错误告诉你的申明并没有实现代码。
你可以在此处ctrl_shift_C自动生成代码,然后在编译看看。

或者鼠标右键,complete class at cursor

Good Luck!
 
接受答案了.
 
后退
顶部