Click here to Skip to main content
15,886,823 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, all
I was trying to manipulate some registry keys in my C++ project on win7, and here is my problem:
when I tried to change some key's value, I met a error - "error editing value". So I can't change it in my project.
Can someone please tell me how can I solve this problem? Is there something about the previliges?
Any answers from you will be appreciated.
PS:I've changed the manifest level to "requireAdministrator", it still not work.
Posted

Sounds like a problem with privileges.

Can you change the value using regedit? You probably have to run regedit as administrator.

On Win 7, even if you are logged in with admin privileges, it seems you have to right click and select "run as administrator" to actually get adminstrator privileges. I suspect by default Win 7 may run programs at a lower privilege level even if the user logon has admin privileges (which makes sense from a security viewpoint.)

If you can change the value using regedit, then you probably just need to make sure your program is actually running with admin privileges.

Are you running under the debugger?

You may have to start visual studio by right clicking and selecting run as administrator in order to get your program to run under the debugger with those same privilege levels. Try it.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-Jun-11 13:16pm    
My 5. Maybe OP did not get it (your 3rd paragraph). Look at the (deleted) solution where OP says it's run as administrator. I'm not quite sure.
--SA
Check this->[^]

Please check my answer SetAppAsDefault.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900