type
TIntFunc=function(i:integer):integer;stdcall;
var
Th:Thandle;
Tf:TIntFunc;
//Tp:TFarProc;begin
Th:=LoadLibrary('d:\dll3\dll3.dll');
if Th>0 thentry@Tf:=GetProcAddress(Th,'Test');
//<:::::::::::::::::这里@tf总是nil,但是我的dll3.dll里确实有test这个函数啊
//我用静态调用都可以的:)
if @Tf<>nil then
TIntFunc=function(i:integer):integer;stdcall;
var
Th:Thandle;
Tf:TIntFunc;
//Tp:TFarProc;begin
Th:=LoadLibrary('d:\dll3\dll3.dll');
if Th>0 thentry@Tf:=GetProcAddress(Th,'Test');
//<:::::::::::::::::这里@tf总是nil,但是我的dll3.dll里确实有test这个函数啊
//我用静态调用都可以的:)
if @Tf<>nil then
Th:=LoadLibrary('d:\dll3\dll3');后面不要dll,否则他就找不到
test;
我是刚学DEPHI的哦,请大家帮忙拉
funname : function(i:integer):integer;stdcall;
hdll : Thandle;
begin
hdll := loadlibrary('dllname.dll');
if hdll <= 0 then
begin
showmessage('load Fail');
exit;
end;
funname := GetProcAddress(hdll,'调用函数名');
if not Assigned(funname) then
BEGIN
showmessage('getprocaddress FAIL');
exit;
END;
end;
TIntFunc=function(i:integer):integer;stdcall;
var
Th:Thandle;
Tf:TIntFunc;
Tp:TFarProc;begin
Th:=LoadLibrary('d:\dll3\dll3.dll');
if Th>32 then
begin
Tp:=GetProcAddress(Th,'Test');
TIntFunc(Th)(6);
end;
end;