>
>Mainly because I am new to c++ and did not know about it.... But anyway
the following code gives the output "failed with error 127: The specified
procedure could not be found."... any help?
>
>#include <windows.h>
>#include <iostream.h>
>
>
>int main() {
> HKEY hkey;
>
> if((RegOpenKeyEx(HKEY_CURRENT_USER,
>
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\test
"),
> 0,
> 1,
> &hkey)) == ERROR_SUCCESS) {
>From MSDN Library:
"The key identified by the hKey parameter must have been opened with
KEY_SET_VALUE access. To open the key, use the RegCreateKeyEx or
RegOpenKeyEx function."
So...to fix the problem (I, for one, don't know what "1" means - and don't
care for those who are looking in their Platform SDK), don't use numbers
for access permissions and just to make sure you have enough permissions,
give the call KEY_WRITE (which includes KEY_SET_VALUE). Use the
appropriate mask values:
if (RegOpenKeyEx(HKEY_CURRENT_USER,
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\test
"), 0, KEY_WRITE, &hkey) == ERROR_SUCCESS)
Try that - it should work even though I didn't try it out.
Thomas J. Hruska
[EMAIL PROTECTED]
Shining Light Productions
Home of the Nuclear Vision scripting language and ProtoNova web server.
http://www.slproweb.com/
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
