包中类导出实例

procedure TFrmMain.btn1Click(Sender: TObject);
var
  MyObj: TbplTest;
  p: Pointer;
  d:TClass;
  s: TFormShow;
begin
  d := GetClass('TTbplTest');
  if d <> nil then
  begin
    MyObj := d.NewInstance as TbplTest;
    MyObj.Create;
    @s:= MyObj.MethodAddress('ShowInfo');  

    s('test');
    FreeAndNil(MyObj);
  end;

end;

posted @ 2011-04-23 19:43  gxch  阅读(194)  评论(0编辑  收藏  举报