主应用程序调用DLL,DLL创建窗体A,现希望窗体A停靠到主应用程序中的panel中,但停靠进去的窗体显示不出来,只能显示出顶部的两个细横杆和关闭的小叉!大家帮忙解决一下!!

解决方案 »

  1.   

    你写Parent了吗?
    你传递的参数是什么??
    代码写出来啊,—……
      

  2.   

    是不是DLL中的窗口本身就是块空白哟,或者控件位置被遮住了。
    拖动那个小横杆,把窗口拽出来看看就知道了
      

  3.   

    //DLL
    library Project1;uses
      SysUtils,
      Classes,
      Controls,
      Forms,
      Unit1 in 'Unit1.pas' {Form1};{$R *.res}procedure startWithDock(app:THandle;dockControl:TWinControl);stdcall;
    begin
      if Form1=nil then begin
        application.Handle:=app;
        Form1:=TForm1.Create(application);
        Form1.ManualDock(dockControl,nil,alClient);
        Form1.Show;
      end
      else begin
        Form1.Show;
      end;
    end;procedure quitAndFree();stdcall;
    begin
      if Form1<>nil then begin
        Form1.Free;
        Form1:=nil;
      end;
    end;exports
     startWithDock,quitAndFree;begin
      Form1:=nil;
    end.//DLLForm1
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Memo1: TMemo;
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}end.
      

  4.   

    //调用DLLForm 的Application
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtCtrls, unit2;type
      TForm1 = class(TForm)
        Panel1: TPanel;
        Panel2: TPanel;
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementationprocedure startWithDock(app:THandle;dockSite:TWinControl);stdcall;external 'project1.dll';
    procedure quitAndFree;stdcall;external 'project1.dll';{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      startWithDock(application.Handle,panel2);
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
      quitAndFree;
    end;end.
      

  5.   

    要把Appliction.Handle和Screen对象传入DLL,并赋值给DLL中对应的DD
      

  6.   

    ysai(蓝色忧郁) 能简写个代码,说详细点么???
      

  7.   

    function FormFunction(aHandle: THandle; aScreen: TScreen): Boolean; stdcall;
    begin
      Application.Handle := aHandle;
      Screen := aScreen;
      frmMain1 := TfrmMain1.Create(nil);
      frmMain1.Show;
    end;
      

  8.   

    不行呀!我需要把DLL中的form,停靠到application中的panel里,但是停靠进去的DLLform中的内容都显示不出来!!! 但是仅仅show出form是没有问题的!!!