源程序如下:
library Project1;{ 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,
  Unit1 in 'Unit1.pas';
exports
    max index 1, //******出错的地方****8
    min index 2,
    cre index 3;{$R *.res}begin
end.Unit1.pas 源码****8unit Unit1;interface
 type
    Tcomp=class
    public
     function max(x,y:integer):integer;virtual;abstract;
     function min(x,y:integer):integer;virtual;abstract;
    end;
  Tcomp11=class(Tcomp)
    public
     function max(x,y:integer):integer;override;export;
     function min(x,y:integer):integer;override;export;
    end;
function cre:Tcomp11;stdcall;export;
implementation
function Tcomp11.max(x,y:integer):integer;   //求和
begin
result:=x+y;
end;
function Tcomp11.min(x,y:integer):integer;      //求乘积
 begin
   result:=x*y;
 end;
function cre:Tcomp11; stdcall;
 begin
   result:=Tcomp11.Create;
 end;end.