F
fusm_2000
Unregistered / Unconfirmed
GUEST, unregistred user!
因為要調用很多DLL﹐所以想寫一個函數調用它﹐但會出錯﹐請高手指點﹕
procedure TFrmMainManager.Check_receive1Click(Sender: TObject);
var
receivehan:Thandle;
begin
try
receivehan:=loadlibrary('receivedll.dll');
if receivehan<1 then
begin
showmessage('加載動態庫receivedll失敗!');
abort;
end;
receiverev:=getprocaddress(receivehan,'receiverev');
if @receiverev=nil then
begin
showmessage('加載函數receiverev失敗!');
abort;
end;
revout:=receiverev();
finally
freelibrary(receivehan);
end;
procedure TFrmMainManager.Check_receive1Click(Sender: TObject);
var
receivehan:Thandle;
begin
try
receivehan:=loadlibrary('receivedll.dll');
if receivehan<1 then
begin
showmessage('加載動態庫receivedll失敗!');
abort;
end;
receiverev:=getprocaddress(receivehan,'receiverev');
if @receiverev=nil then
begin
showmessage('加載函數receiverev失敗!');
abort;
end;
revout:=receiverev();
finally
freelibrary(receivehan);
end;