Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is DLL.Ocx Registered or Not
Message
From
13/12/2006 12:26:49
 
 
To
13/12/2006 00:09:08
Rahul Murarka
Sys-Con Engineering
Kolkata, India
General information
Forum:
Visual Basic
Category:
ActiveX controls
Miscellaneous
Thread ID:
01177068
Message ID:
01177254
Views:
9
>I have one code with me but not working. If you want just correct it.
>
>'-------------------------------------------------------
>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
>'-------------------------------------------------------
>
>

Rahul

I tried this code and it worked successfully.. It doesn't check the path, though, which would be problematic without manually searching the registry.

If you know the class name you are interested in (eg Excel.Application) you can probably find out what DLL it uses:

1) Look up the class name in HKEY_CLASSES_ROOT
2) Extract the CLSID from the CLSID subkey
3) Navigate to HKEY_CLASSES_ROOT\CLSID\{CLSID} using the value determined above
4) Look at the LocalServer32 subkey to find the associated DLL (it's the default value)

(This may not be exactly the case for types of components)
Previous
Reply
Map
View

Click here to load this message in the networking platform