forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Check if a DLL exists / is loaded

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Units
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Jan 02, 2004 8:37 pm    Post subject: Check if a DLL exists / is loaded Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Units All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group