Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need an example for the GetRegKey() in registry.vcx
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00572563
Message ID:
00572662
Vues:
39
>Snip
>
>You need to first open the key using the OpenKey() method. If you do not specify a key it defaults to HKEY_CLASSES_ROOT. Here's an example:
lckey = "Excel.Application\CurVer"
>SET CLASSLIB TO REGISTRY.VCX ADDITIVE
>oReg = CREATEOBJECT("Registry")
>RELEASE CLASSLIB REGISTRY
>IF oReg.OpenKey(lckey) = 0 && No error
>  lcvalue = ""
>  IF oReg.GetKeyValue("", @lcvalue) = 0 && No error
>    ? lcvalue
>  ENDIF
>  oReg.CloseKey()
>ENDIF
George,

It works fine, but if I purely as an example do the following:
lckey = "Environment\Temp"                && That's ok, right?
HKEY_CURRENT_USER=-2147483647             && Nothing wrong with that? 
? oReg.OpenKey(lckey,HKEY_CURRENT_USER)=0 && Returns .F.
oReg.OpenKey(lckey,HKEY_CURRENT_USER,.F.)=0 didn't do any better.

IntelliSense prompts for CLOOKUPKEY which I assume equals lcKey,
NREGKEY, which I figured as HKEY_CURRENT_USER and finally lcreatekey, which I set as .F.

Please bear with me, because I obviously have not understood all of this just yet.
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform