// to: piao40993470 确实不错
//呵呵!不过还是有点麻烦,同样是取指针,用Pointer不更好呢?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure TestIt(str: string);
procedure FuncIt(str: string
TE: Integer)
// 这里过程
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//uses QuickEmpolder;
//var
// Test: TQuickEmpolder;
procedure TForm1.FormCreate(Sender: TObject);
begin
//
end;
procedure TForm1.TestIt(str: string);
begin
showmessage(str)
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// Test := TQuickEmpolder.Create(self);
// Test.SysFunc.ExecuteRoutine(Form1, 'Button2Click', [button2]);
// Test.SysFunc.ExecuteRoutine(Form1, 'TestIt', ['test']);
end;
procedure TForm1.FuncIt(str: string
TE: Integer);
begin
ShowMessage(Str + IntToStr(TE));
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage(sender.ClassName)
end;
procedure TForm1.Button3Click(Sender: TObject);
var
Func: Pointer;
begin
Func := @TForm1.Button3Click;
ShowMessage(Form1.MethodName(Func));
Func := @TForm1.TestIt;
ShowMessage(Form1.MethodName(Func));
Func := @TForm1.FuncIt;
ShowMessage(Form1.MethodName(Func));
end;
end.