Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: video ram Pin
includeh1012-Jul-06 2:48
includeh1012-Jul-06 2:48 
QuestionRe: video ram Pin
David Crow12-Jul-06 2:54
David Crow12-Jul-06 2:54 
AnswerRe: video ram Pin
Hamid_RT12-Jul-06 3:21
Hamid_RT12-Jul-06 3:21 
Questionsame structure behave differntly in different application Pin
pavan105nagarbhavi12-Jul-06 1:48
pavan105nagarbhavi12-Jul-06 1:48 
AnswerRe: same structure behave differntly in different application Pin
_AnsHUMAN_ 12-Jul-06 2:16
_AnsHUMAN_ 12-Jul-06 2:16 
QuestionRe: same structure behave differntly in different application Pin
David Crow12-Jul-06 2:59
David Crow12-Jul-06 2:59 
AnswerRe: same structure behave differntly in different application Pin
Zac Howland12-Jul-06 3:41
Zac Howland12-Jul-06 3:41 
QuestionRegistry - RegSetValuEx - Returning Access denied ?? Pin
elitecodex12-Jul-06 1:43
elitecodex12-Jul-06 1:43 
Hey everyone. I have a function that reads in a registry value (for
the windows firewall) and one that disables it.

<code>
void wxJobsPanel::DisableWindowsFirewall()
{
HKEY hkeyFirewall;

/*
if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, registryLocations[0], 0, KEY_ALL_ACCESS, &hkeyFirewall) != ERROR_SUCCESS)
wxLogError("FAILED - Could not open the firewall policy registry entry");
*/
if ( RegCreateKeyEx(
HKEY_LOCAL_MACHINE,
registryLocations[0],
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_WRITE,
NULL,
&hkeyFirewall,
NULL) != ERROR_SUCCESS )
wxLogError("FAILED - Could not open the firewall policy registry entry");

else
{
DWORD value = 0;
if ( RegSetValueEx(hkeyFirewall, "EnableFirewall", 0, REG_DWORD, (LPBYTE) &value, sizeof(DWORD)) != ERROR_SUCCESS )
{
ErrorString("DisableWindowsFirewall()");
wxLogError("FAILED - Could not set the EnableFirewall value");
}
RegCloseKey(hkeyFirewall);
}
}</code>

The error is in RegSetValue. It returns "Access denied". ErrorString
is almost taken completely out of the PlatformSDK which is how Im
getting the error. Ive tried both methods above, using both the RegCreateKeyEx and RegOpenKeyEx. I can open (and read in a different function) with no problem. I can edit the value no problem using regedit. Just this seems to fail and I do not know why.


I've also tried opening the key with KEY_ALL_ACCESS and KEY_SET_VALUE
in combination with KEY_WRITE | KEY_READ.

Any ideas? The user is in the Administrator group. Thanks!



AnswerRe: Registry - RegSetValuEx - Returning Access denied ?? Pin
Steve S12-Jul-06 3:11
Steve S12-Jul-06 3:11 
GeneralRe: Registry - RegSetValuEx - Returning Access denied ?? [modified] Pin
elitecodex12-Jul-06 4:51
elitecodex12-Jul-06 4:51 
GeneralRe: Registry - RegSetValuEx - Returning Access denied ?? Pin
Steve S12-Jul-06 6:51
Steve S12-Jul-06 6:51 
QuestionProblem with size of child window Pin
g_sandipan12-Jul-06 1:16
g_sandipan12-Jul-06 1:16 
AnswerRe: Problem with size of child window [modified] Pin
Sarath C12-Jul-06 1:29
Sarath C12-Jul-06 1:29 
GeneralRe: Problem with size of child window Pin
g_sandipan12-Jul-06 2:00
g_sandipan12-Jul-06 2:00 
Questionpressing return in an edit control Pin
Desmo1612-Jul-06 0:38
Desmo1612-Jul-06 0:38 
AnswerRe: pressing return in an edit control Pin
Sarath C12-Jul-06 0:45
Sarath C12-Jul-06 0:45 
GeneralRe: pressing return in an edit control [modified] Pin
see me12-Jul-06 1:13
see me12-Jul-06 1:13 
GeneralRe: pressing return in an edit control Pin
Hamid_RT12-Jul-06 1:16
Hamid_RT12-Jul-06 1:16 
GeneralRe: pressing return in an edit control Pin
Sarath C12-Jul-06 1:27
Sarath C12-Jul-06 1:27 
GeneralRe: pressing return in an edit control Pin
FarPointer12-Jul-06 1:49
FarPointer12-Jul-06 1:49 
AnswerRe: pressing return in an edit control Pin
Naveen12-Jul-06 0:47
Naveen12-Jul-06 0:47 
GeneralRe: pressing return in an edit control Pin
Naveen12-Jul-06 1:11
Naveen12-Jul-06 1:11 
AnswerRe: pressing return in an edit control Pin
ThatsAlok12-Jul-06 0:57
ThatsAlok12-Jul-06 0:57 
AnswerRe: pressing return in an edit control Pin
Hamid_RT12-Jul-06 1:02
Hamid_RT12-Jul-06 1:02 
QuestionShell Execute Pin
anu_8812-Jul-06 0:06
anu_8812-Jul-06 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.