Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining If ActiveX Control Is Registered
Message
De
30/08/2000 19:04:37
 
 
À
30/08/2000 18:48:29
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00411083
Message ID:
00411119
Vues:
18
>>>Hi All,
>>>
>>>How would I be able to determine if a OCX file, DLL file, or ActiveX control has been registered?
>>>
>>
>>Check to see if the ProgID is found under HKEY_CLASSES_ROOT\COM object ProgID in the registry.
>>If it is, the CLSID should be in a subkey. Check HKEY_CLASSES_ROOT\CLSID and make sure that the server subkey and other information is stored under the CLSID, and any files are where they're specified.
>
>Sorry, but how would I be able to do this syntactically? Is there an VFP or API function that does this sort of thing?
>

The FFC contains a class that can read and write from the registry, Registry.VCX, with a class named registry.
#INCLUDE REGISTRY.H
oReg = NEWOBJECT('Registry','Registry.VCX')
IF oReg.GetRegKey('',"<i>ProgIDofControl</i>\CLSID",HKEY_CLASSES_ROOT) # 0
   *  ProgID is not correct, so register
ENDIF
cCLSID = SPACE(0)
=oReg.OpenKey("<i>ProgIDofControl</i>\CLSID",HKEY_CLASSES_ROOT)
=oReg.GetKeyValue('',@cCLSID)
IF oReg.GetRegKey('',cCLSID,HKEY_CLASSES_ROOT) # 0
   *  Missing CLSID
ENDIF
It gets painful. Reregistering the control is generally safe, and may avoid version problems if the ProgID doesn't change between versions.
>Thanks in advance,
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform