Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Registry searching
Message
De
05/09/2001 13:37:15
 
 
À
05/09/2001 11:31:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00552567
Message ID:
00552684
Vues:
11
>Hi All,
>
>What I need to do is search the registry to see if an .OCX file is registered on the user’s system. If not register it. Since I have 0 knowledge of using the registry. Could someone point me in the direction of where to look? I tried FAQ: 582 but am not sure if I am using it correctly. Or if this is the right approch.
>
>nResult = RegOpenKeyEX(HKEY_LOCAL_MACHINE, "C:\WINNT\system32\MMail32.OCX", 0, KEY_READ, @hKey)
>

The problem here is that the registry doesn't track the file, but rather, it tracks the classes contained in the OCX. You need to check the registry hive HKEY_CLASSES_ROOT for subkey(s) matching the name(s) of the ActiveX control classes, and if they're present, check the same hive for the indicated CLSID of the entry for the InprocServer32 subkey, which gives the name of the file assigned to handle the ActiveX call. You don't want to check for a path, because (1) different OSes may not have the same folder structures, (2) the ActiveX control can be registered from any folder and (3) the version of the file is in all likelihood just as important as the file name.

>'nResult' always gave '2' even if I put a bogus file name in RegOpenKeyEX(). I know that is the path where it is registered on my system.

There's an FFC class that serves as a wrapper on the API calls related to the registry which will probably be easier to use and understand.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform