Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read Registry Thru WMI/API Not Working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00674007
Message ID:
00675075
Vues:
14
Thanks. Dopey mistake.

>You've to pass variable by reference in order for the function to return value into it.
cRetVal = ""
>iErrNo = oReg.GetStringValue( HKEY_LOCAL_MACHINE , cKeyPath , "DisplayName" , @cRetVal )
>
>>Why does this not work? It should say "Standard IDE/ESDI Hard Disk Controller"
>>The equivalent works fine in WSH/VBScript.
>>
>>
>>#include registry.h
>>
>>
>>	oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
>>	cKeyPath = "SYSTEM\CurrentControlSet\Services\atapi"
>>	Local cRetVal as String
>>	iErrNo = oReg.GetStringValue( HKEY_LOCAL_MACHINE , cKeyPath , "DisplayName" , cRetVal )
>>	
>>	? cRetVal
>>	? iErrNo
>>
>>
>>Thanks.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform