beginTh:=LoadLibrary('ZLDS200_TCP_DLL.dll'); {裝載DLL}if Th>0 thentryTp:=GetProcAddress(Th,PChar('ZLDS200Connect'));if Tp<>nil thenbeginTf:=TIntFunc(Tp);IntToStr(Tf(620)); {調用ZLDS200Connect函數}endelseShowMessage('ZLDS200Connect函數沒有找到');finallyFreeLibrary(Th); {釋放DLL}endelseShowMessage('ZLDS200_TCP_DLL.dll沒有找到');end;
3 回答

呼啦一陣風
TA貢獻1802條經驗 獲得超6個贊
begin
Th:=LoadLibrary('ZLDS200_TCP_DLL.dll'); {裝載DLL}
if Th>0 then
begin
try
Tp:=GetProcAddress(Th,PChar('ZLDS200Connect'));
if Tp<>nil then
begin
Tf:=TIntFunc(Tp);
IntToStr(Tf(620)); {調用ZLDS200Connect函數}
end
else
ShowMessage('ZLDS200Connect函數沒有找到');
finally
FreeLibrary(Th); {釋放DLL}
end;
end
else
ShowMessage('ZLDS200_TCP_DLL.dll沒有找到');
end;
添加回答
舉報
0/150
提交
取消