有Dll创建的例子么。高分奉送。

解决方案 »

  1.   

    file->new->other->dll w..library Project2;uses
      SysUtils,
      Classes;{$R *.res}function add(a,b:integer):integer;
    begin
            result:=a+b;
    end;exports
    add;begin
    end.====================================================
    //app code    两个edit  1个button
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Edit2: TEdit;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation
      function add(a,b:integer):integer;external 'Project2.dll';{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
    caption:=inttostr(add(strtoint(edit1.Text),strtoint(edit2.Text )));
    end;end.
      

  2.   

    DLL的输入函数中创建对象要注意!
      

  3.   

    老弟愚钝,怎么把一个窗体封装进一个DLL!
      

  4.   

    flyinger(琉璃翡翠):  1 new a Form   
      2 function CreateForm(): TForm; stdcall;
      3 exports CreateForm;
      

  5.   

    如上用dllwizard创建一个,其中文本用.dll保存,
    写一个程序调用看看。