Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Jan 02, 2004 8:37 pm Post subject: Check if a DLL exists / is loaded |
|
|
Hi all,
This is a little function to check if a DLL is in the right directory to be loaded, or to check if the DLL is registered. By using the "PATH" parameter, you will receive the path of the DLL. Otherwise you will get 'nul' or a value which is higher.
Code: | #define function,CheckDLL
if @CheckDLL("vdsrun50.dll")
info The vdsrun50.dll exists and can be loaded...
else
info The vdsrun50.dll does not exists and can no be loaded...
end
info @CheckDLL("vdsrun50.dll",PATH)
exit
:CheckDLL
if @equal(%1,)
error 2
exit
end
%a = @fill(255)
loadlib kernel32
%z = @lib(kernel32,SearchPathA,INT:,0,%1,0,255,@addr("%a"))
freelib kernel32
if @equal(%2,"PATH")
exit @trim(@adjust(%A))
else
if @equal(@trim(%z),0)
exit
else
exit @trim(%z)
end
end
exit |
|
|