TObject的MethodAddress类方法的使用
日期:2007-05-22 荐:
TObject的MethodAddress类方法的使用TObject类的类方法MethodAddress(const Name:ShortString):Pointer;返回函数Name的地址。我现在就是想把地址取出来,但是不知道怎么办。如下:procedure TForm1.Button1Click(Sender: TObject);var addr: string; pnt: Pointer; pi: ^longint;begin addr := 'Button1Click'; pnt := self.MethodAddress(addr); Memo1.Lines.Add(pi(pnt^)); //这里有错,怎么改呢?end;谢谢了!procedure TForm1.Button1Click(Sender: TObject);var addr: string; pnt: Pointer;begin addr := 'Button1Click'; pnt := Self.MethodAddress(addr); Memo1.Lines.Add(IntToStr(Integer(pnt))); //这里有错,怎么改呢?end;是十进制的!procedure TForm1.Button1Click(Sender: TObject);var addr: string; pnt: Pointer;begin addr := 'Button1Click'; pnt := Self.MethodAddress(addr); Memo1.Lines.Add(IntToStr(Integer(pnt)));end;
标签: