M
mypool
Unregistered / Unconfirmed
GUEST, unregistred user!
根據http://www.delphibbs.com/delphibbs/dispq.asp?lid=3446912
上面的事例做的,但出錯???
1,在Delphi主菜单file 中选new...项,在弹出的窗口中双击DLL wizard
library minmax;
function Min(X, Y: Integer): Integer; export;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): Integer; export;
begin
if X > Y then Max := X else Max := Y;
end;
exports
Min index 1,
Max index 2;
begin
end.
2,建单元文件testdll .pas
unit testdll;
interface
uses
function Min (X, Y: Integer): Integer;
function Max (X, Y: Integer): Integer;
implementation
function Min; external ‘minmax.DLL’;
function Max; external ‘minmax.DLL’;
end.
3,
调用minmax.DLL中的函数
uses testdll
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(inttostr(Min(1,2)));
end;
報'file not found: testdll.dcu' 錯誤???????
上面的事例做的,但出錯???
1,在Delphi主菜单file 中选new...项,在弹出的窗口中双击DLL wizard
library minmax;
function Min(X, Y: Integer): Integer; export;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): Integer; export;
begin
if X > Y then Max := X else Max := Y;
end;
exports
Min index 1,
Max index 2;
begin
end.
2,建单元文件testdll .pas
unit testdll;
interface
uses
function Min (X, Y: Integer): Integer;
function Max (X, Y: Integer): Integer;
implementation
function Min; external ‘minmax.DLL’;
function Max; external ‘minmax.DLL’;
end.
3,
调用minmax.DLL中的函数
uses testdll
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(inttostr(Min(1,2)));
end;
報'file not found: testdll.dcu' 錯誤???????