可以,没什么不可以得。Delphi的类和C++的类不同。Delphi的类不过是一个引用,所以效率很高。

解决方案 »

  1.   

        你为什么这么做呢?如果需要导出数据,直接把这个窗体DBGrid的数据DataSet传递给
    你的函数不就可以了吗?
        传递TForm是可以的。下面是我的例子,可以让一个窗口震动一下。
    procedure shockWindow(AForm:TForm);
    var
      intX,intY,intLoop:integer;
      intOX,intOY:Integer;
    begin
      AForm.Refresh;
      intOX:=AForm.Left;
      intOY:=AForm.Top;
      intLoop:=5;
      while intLoop>0 do
      begin
        intX:=intOX-intLoop;
        intY:=intOY-intLoop;
        AForm.Left:=intX;
        AForm.Top:=intY;
        sleep(50);
        intX:=intOX-intLoop;
        intY:=intOY+intLoop;
        AForm.Left:=intX;
        AForm.Top:=intY;
        sleep(50);
        intX:=intOX+intLoop;
        intY:=intOY-intLoop;
        AForm.Left:=intX;
        AForm.Top:=intY;
        sleep(50);
        intX:=intOX+intLoop;
        intY:=intOY+intLoop;
        AForm.Left:=intX;
        AForm.Top:=intY;
        sleep(50);
        dec(intLoop,1);
      end;
      AForm.Left:=intOX;
      AForm.Top:=intOY;
    end;调用方法如下:shockWindow(Form名称)   如果你要实现对传入的TForm中的DBGrid直接引用是不可能的,
    你要引用DBGrid需要用到搜索传入的Form的Components。
      

  2.   

    procedure ShowForm(FormName:TForm);
    begin
      With FormName.Create(nil) do
      try
        ShowModal;
      finally
        Free;
      end;
    end;
      

  3.   

    多谢各位帮忙,问题大概解决:
    可以用如下方式定义和传递:
    定义过程:               procedure  userword(frm:tform;dt:dataset)
                            begin
                            ........
                            end;
    调用:
    var frm:tform;
        dt:tdataset;
    begin
       frm:=form2;
       dt:=table1;
       form1.userword(frm,dt) ;
    ......
    end;