我找到个dll,里面封装了个窗体,窗体如见图,有个oncreate事件,已知用这个事件可以把窗体显示出来!
请问一下,能不能做个exe把那个窗体显示出来,代码怎么写!

解决方案 »

  1.   

    啥事件,DLL的事件? 没消息循环咋来事件 - -?你最好封装一个函数在 Dll 中
    function 函数名; external dll名 name 'dll名';调用该函数,函数内容中创建窗体 CreateWindow;
      

  2.   

    //dll 例子library yb_sfxmdz;{ Important note about DLL memory management: ShareMem must be the
      first unit in your library's USES clause AND your project's (select
      Project-View Source) USES clause if your DLL exports any procedures or
      functions that pass strings as parameters or function results. This
      applies to all strings passed to and from your DLL--even those that
      are nested in records and classes. ShareMem is the interface unit to
      the BORLNDMM.DLL shared memory manager, which must be deployed along
      with your DLL. To avoid using BORLNDMM.DLL, pass string information
      using PChar or ShortString parameters. }uses
      SysUtils,
      Classes,
      main in 'main.pas' {FormMain},
      ReportUtility in 'ReportUtility.pas';{$R *.RES}exports fyb_sfxmdz;begin
    end.
      

  3.   

    //调用例子unit testdllmain;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      Menus;type
      Ttestform = class(TForm)
        MainMenu1: TMainMenu;
        testmenu1: TMenuItem;
        procedure testmenu1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      testform: Ttestform;implementationuses main;{$R *.DFM}procedure Ttestform.testmenu1Click(Sender: TObject);
    begin
        fyb_sfxmdz;
    end;
    end.
      

  4.   

    你要看这个dll的输出函数有什么,否则没法用