Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is DLL.Ocx Registered or Not
Message
De
13/12/2006 12:26:49
 
 
À
13/12/2006 00:09:08
Rahul Murarka
Sys-Con Engineering
Kolkata, Inde
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Divers
Thread ID:
01177068
Message ID:
01177254
Vues:
10
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform