Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for DLL Registration Before Using CreateObject(
Message
De
17/03/2003 14:46:47
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00766669
Message ID:
00766678
Vues:
17
A trick I have chosen to use is to create a class that accepts the character string you would use in the createObject call (i.e. "Excel.Application") as a parameter and try to call createObject. I put code in the error method of the class to return .f. on error. If it creates the object successfully, it releases it and returns .t. You could also choose to just return the object, but I prefer to keep the return type as logical and just grab the object again.

The code would look something like this in use:

if isRegistered("Excel.Application")
oExcel = createObject("Excel.Application")
endif
Paul A. Busbey
Victoria Insurance
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform