文件名没问题,扩展名也要区分大小写吗?如果区分,程序中也没有涉及到啊.属性上都是小写.
很简单,不需要注册吧!这是代码!
library mydll;
uses
; SysUtils,
; Classes,
; Unit1 in 'Unit1.pas';
{$R *.RES}
function Test1(a,b:integer):integer ;
begin
Result:=a+b;
end;
exports
Test1 index 1;
begin
end.
这是调用代码
unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
; StdCtrls;
type
; TForm1 = class(TForm)
; ; Button1: TButton;
; ; procedure Button1Click(Sender: TObject);
; private
; ; { Private declarations }
; public
; ; { Public declarations }
; end;
var
; Form1: TForm1;
implementation
;function Test1(a,b:integer):integer;external 'mydll';
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
;form1.caption:='1+2='+inttostr(Test1(1,2));
end;
end.