Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read Registry Thru WMI/API Not Working
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00674007
Message ID:
00675075
Views:
13
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform