The code is simple:
I open the location HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\ProductID" using RegOpenKeyEx with read-only attributes
(KEY_READ).
Of course RegEdit works very well and reads the ProductID of Vista without
complains.
Where's my error ? Looks like a security issue but I have no clue..
Mik
--
"Michele Puccini" <m...@c-l-a-s-s-x.it> wrote in message
news:WhEqj.50$Yd7...@nntpserver.swip.net...
Some pointers to vc++ wmi-registry samples ?
Mik
--
"Sam of California" <sam...@social.rr.com_change_social_to_socal> ha scritto
nel messaggio news:47b9c6fe$0$17322$4c36...@roadrunner.com...
If you use WMI to read the registry (it is possible) then you are not
geeting the benefits of WMI. The registry is not documented and therefore is
likely to change, or at least you should assume it will change. You should
not assume that an undocumented solution will always work. WMI provides
documented solutions for requirements such as yours.
The Windows/Platform SDK has sample WMI code. Look at the WMI documentation.
The Technet Script Center has many sample uses of WMI; eventhough they are
scripts, they show the general use of WMI for many things and then anything
they do, you can do using WMI. Just be aware that the amount of C++ code
will be much greater than equivalent script code.
"Michele Puccini" <m...@c-l-a-s-s-x.it> wrote in message
news:PMwuj.6$LY6...@nntpserver.swip.net...
I've read some articles about WMI (thanks for the pointers) and indeed it
seems to be very useful in many ways.
I understand that the c++ code may be more compex/greater than the scripting
counterpart.
Unfortunately I would have to deal with WMI from a DLL and I susppose that
I'll be forced to use c++.
Cheers,
Mik
--
"Sam of California" <sam...@social.rr.com_change_social_to_socal> ha scritto
nel messaggio news:47bb5d3c$0$16660$4c36...@roadrunner.com...