动态加载吧,LoadLibrary
type
TCircleAreaFunc = function (const radius: double) : double; stdcall;
var
dllHandle : cardinal;
circleAreaFunc : TCircleAreaFunc;
begin
dllHandle := LoadLibrary('circle.dll') ;
if dllHandle <> 0 then
begin
@circleAreaFunc := GetProcAddress(dllHandle, 'CircleArea') ;
if Assigned (circleAreaFunc) then
circleAreaFunc(15) ; //call the function
else
ShowMessage('"CircleArea" function not found') ;
FreeLibrary(dllHandle) ;
end
else
begin
ShowMessage('circle.dll not found / not loaded') ;
end;
end;