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:
00675207
Views:
9
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 )
>Arrgh. Still grinding my teeth. What I am trying to do is get the GUID of a COM object so I can explore it programatically. So I make the WMI call to read the Registry for it, but there is no value name. So my code is still exploding.
>
>
>#include registry.h
>Local cRetVal as String
>Clear
>oRegRead = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
>cKeyPath = "dataproc.processor\CLSID"
>iErrNo = oRegRead.GetStringValue( HKEY_CLASSES_ROOT, cKeyPath , , @cRetVal )
>? cKeyPath
>? cRetVal
>? iErrNo
>
>
>It explodes I think on the value between cKeyPath and @cRetVal. I have tried putting in .Null. , Chr(0) , "" , " ", and ,, and it always blows up. How to address that?
>
>Thanks.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform