一個簡單的dll問題?????(30分)

  • 主题发起人 主题发起人 mypool
  • 开始时间 开始时间
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' 錯誤???????
 
自已頂下!!
 
搜索路径中没有testdll.pas
 
3,
调用minmax.DLL中的函数
uses testdll
我已經引用了啊!!!為何還不行???
 
文件路径问题
 
還是通不過?
出現新的提示信息.
'access violation at ox77f92512:write of address ox00030ffc'
 
多人接受答案了。
 

Similar threads

I
回复
0
查看
655
import
I
I
回复
0
查看
689
import
I
I
回复
0
查看
538
import
I
I
回复
0
查看
744
import
I
I
回复
0
查看
895
import
I
后退
顶部