Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to verify that ActiveX/DLL is registered??
Message
 
À
01/03/2005 10:19:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00991555
Message ID:
00991564
Vues:
17
>If you can find it in the registry means it is registered? or we need to check in a specific place.
>
>Mo

If You find it in Registry it means sometime it was registered but somebody can deleted the file :o)))
I thin sure way is to check if You can create an object.

(because I don't know what version of Fox You use this example is universal :o)))
oWord = IsClassRegistered("Word.Application")
IF ISNULL(oWord)
   MessageBox("MS Word is not installed on this computer")
   RETURN
ENDIF
...



FUNCTION IsClassRegistered(cClass)
  LOCAL ret_val, old_error, fl_error
  old_error = ON("ERROR")
  ON ERROR fl_error = .t.
  ret_val = CREATEOBJECT(cClass)
  IF fl_error
     ret_val = NULL
  ENDIF
  ON ERROR &old_error
RETURN ret_val
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform