我还没听说过,编好后的程序装进dll ?

解决方案 »

  1.   

    在工程文件中,把program改成library,移去Uses子句中的Forms,并添加适当的库单元(一般SysUtils、Classes是需要的),删去begin...end之间的所有代码。如果过程、函数准备供其它应用程序调用,则在过程、函数头后加上export 编译指示。编译程序,生成动态链接库文件。
      

  2.   

    作一个dll,输出一个函数,在里面调用exe
      

  3.   

    没错,是要放要资源文件中,可能用到的API有:
    FindResource
    LoadResource
    LockResource
    FreeResource
      

  4.   

    能不能直接封装成dell,也就是说从新编译我的代码,(把我的代码改成dll形式的?)
      

  5.   

    program改成library,移去Uses子句中的Forms,并添加适当的库单元(一般SysUtils、Classes是需要的),删去begin...end之间的所有代码。如果过程、函数准备供其它应用程序调用,则在过程、函数头后加上export 编译指示。编译程序,生成动态链接库文件。
      

  6.   

    to : Shadows(影子) (  ) :
               "能不能直接封装成dell,也就是说从新编译我的代码,(把我的代码改成dll形式的?)"1.open project----youname.dpr
    2.reaname----program -->library
    3. add export :
                  a..in library file:
                code :
                      export
                            youprocedure1 index1,
                            youfunction1 index2,
                            ...
                      end;              b..in unit files:
               code:
                    procedure youprocedure1(...); stdcall;
                    function youfunction1(...):youtype; stdcall;
                    ...                3.save project
    4.build project
      

  7.   

    设置Project options属性,里面Linker页有一项Exe and dll Options!
    选中是不是就可以了,你试一下!
      

  8.   

    用API函数试试:
    FindResource
    LoadResource
    LockResource
    FreeResource
      

  9.   

    做成资源文件.RES,再编译, 使用TResourceStream读出
      

  10.   

    我自己已经解决了,根本不用res,加一句话就行
    mian in mian.pas然后定义一个过程显示窗体就可以了,
      

  11.   

    library DLL;{ 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,
      Dialogs,
      Forms,
     main in 'main.PAS';procedure showmainform(mainForm:TForm);stdcall;
    begin
        mainForm:=Tmainform.Create(mainForm);
        mainform.show;
    end;
    exports
    CdcopyShow;
    begin
    end.然后你调用就可以了,
      

  12.   

    上面的错了
    library DLL;{ 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,
      Dialogs,
      Forms,
     main in 'main.PAS';procedure showmainform(mainForm:TForm);stdcall;
    begin
        mainForm:=Tmainform.Create(mainForm);
        mainform.show;
    end;
    exports
    showmainform; //////
    begin
    end.然后你调用就可以了