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'
,为什么?怎么办呢?谢了
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'
,为什么?怎么办呢?谢了