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:
00696671
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
If ? BITOR(SOMECONSTANT ,0) returns negative number, cast it. If you still not sure, cast all of them.

>What is the pattern/methodology for figuring that out? I want to see how to do the same with HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER and etc.
>
>Thanks.
>
>>It looks like incorrect type is passed as the first parameter. Casting the value with BITOR fixes the problem.
#include registry.h
>>#UNDEFINE HKEY_CLASSES_ROOT
>>#DEFINE HKEY_CLASSES_ROOT BITOR(0x80000000,0)
>>cRetVal = ""
>>oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
>>cKeyPath = "dataproc.processor\CLSID"
>>iErrNo = oReg.GetStringValue( HKEY_CLASSES_ROOT, @cKeyPath , "", @cRetVal )
>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform