应该exports函数名,而不是单元名称。
比如:
library Test;{$R *.res}function GetNumber(AStr: string): Integer;
begin
  Result := 0;
end;exports
  GetNumber;begin
end.

解决方案 »

  1.   

    我的函数在单元中
    是一个显示窗体的DLL
      

  2.   

    你的exports中的unitl是沙么意思,
    他应该是一个涵数才行啊
      

  3.   

    把函数放在Unit中,也要在exports中发布
      

  4.   

    具体帮我写一下好吗 
    为什么我把函数放在private处
    系统告诉我没有使用呢
      

  5.   

    我的单元代码如下: 
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Button1: TButton;
      private
        { Private declarations }  public
        { Public declarations }
      function dllshow:boolean;
      end;implementationuses dllform;
    {$R *.DFM}
    function dllshow:boolean;
      var
      form1:tform;
      pword:integer;
      begin
      pword:=0;
      form1:=tform.create(application);
      pword:=pword+1;
      result:=true;
      form1.show;
      end;
    end.
      

  6.   

    现在系统提示我 UNIT循环利用它本身
      

  7.   


    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Button1: TButton;
      private
        { Private declarations }  public
        { Public declarations }
      function dllshow:boolean;
      end;function dllshow:boolean; stdcall;
    implementationuses dllform;{$R *.DFM}
    function dllshow:boolean; stdcall;
      var
      form1:tform;
      pword:integer;
      begin
      pword:=0;
      form1:=tform.create(application);
      pword:=pword+1;
      result:=true;
      form1.show;
      end;
    end.library Project1;uses
      Unit1 in 'Unit1.pas' {Form1};{$R *.RES}exports
      dllshow;
    begin
    end.
      

  8.   

    系统提示我没有发DLLFORM1.dcu没有发现 
    有窗体的 
    DLL
    真烦人啊
      

  9.   

    你的Delphi的水平比较差,努力学习吧。unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Button1: TButton;
      private
        { Private declarations }  public
        { Public declarations }
      function dllshow:boolean;
      end;function dllshow:boolean; stdcall;
    implementation{$R *.DFM}
    function dllshow:boolean; stdcall;
      var
      form1:tform;
      pword:integer;
      begin
      pword:=0;
      form1:=tform.create(application);
      pword:=pword+1;
      result:=true;
      form1.show;
      end;
    end.
      

  10.   

    大哥去掉这个也不行 
    我知道不应该uses dllform 
    那有你行啊 三个红星 
      

  11.   

    chechy 兄 你把这段代码 编译一下 盾看是否能通过好吗
      

  12.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Button1: TButton;
      private
        { Private declarations }  public
        { Public declarations }
      end;function dllshow:boolean; stdcall;
    implementation{$R *.DFM}
    function dllshow:boolean; stdcall;
      var
      form1:tform;
      pword:integer;
      begin
      pword:=0;
      form1:=tform.create(application);
      pword:=pword+1;
      result:=true;
      form1.show;
      end;
    end.