[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Determine if DLL is available

Posted on 2006-06-09
6
Medium Priority
?
562 Views
Last Modified: 2012-05-07
Hi,

    When using APIs' how can i determine via VB or VBA whether a PC has a particular DLL loaded/registered (i.e useable)?

     For example;

          If i used the API function  

            "Function KillTimer Lib "user32" Alias "KillTimer" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long"

         How can i determine if user32.dll is available and can be used on the PC containing the function?

  Cheers
0
Comment
Question by:janoxley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 16873894
Well user32,kernel32 etc.. will always be there as the are core system files. Unless on a 16 bit system than its User.dll

You can check an API supported OS on microsoft website

http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/timers/timerreference/timerfunctions/killtimer.asp
Scroll down to Function Information
0
 
LVL 13

Accepted Solution

by:
iHadi earned 1000 total points
ID: 16874460
Hi

Try the following code:
-------------------------------------------------------
Public Function IsRegistered(ByVal class As String) As Boolean
On Error Goto NotRegistered
Dim obj As Object
Set obj = CreateObject(class)
IsRegistered = True
Exit Function
NotRegistered:
End Function
'-------------------------------------------------------

Example Usage:

'-------------------------------------------------------
If Not IsRegistered("Excel.Application") Then
MsgBox "Excel is not installed/registered."
Else
MsgBox "Excel is installed & registered."
End If
'-------------------------------------------------------
' Source url: http://experts.about.com/q/Visual-Basic-1048/DLL-OCX-Registered.htm
0
 
LVL 1

Assisted Solution

by:ciao
ciao earned 1000 total points
ID: 16879230
You can call LoadLibrary Api and check return value, if it is false the Api isn't avaible.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question