Определение функции в DLL

Данная функция определяет присутствие нужной функции в библиотеке (dll) и, в случае нахождения искомой функции возвращает True, иначе False.

function FuncAvail (VLibraryname, VFunctionname: string; var VPointer: pointer):
boolean;
var
Vlib: tHandle;
begin
Result := false;
VPointer := NIL;
if LoadLibrary(PChar(VLibraryname)) = 0 then
exit;
VPointer := GetModuleHandle(PChar(VLibraryname));
if Vlib <> 0 then
begin
VPointer := GetProcAddress(Vlib, PChar(VFunctionname));
if VPointer <> NIL then
Result := true;
end;
end;

Взято из http://forum.sources.ru

© GAiST 2004 - 2008