tHANKS Alexander, me again, i get the value what i want, BUT in case be 0 i do this:
else
{
GetDlgItem(IDC_DHCP)->SetWindowText("DHCP No
Instalado, configurando....");
DWORD nSi;
nSi = 1;
int nErrorX;
nErrorX=oRegKey.SetValue(nSi,_T("EnableDHCP"));
//ey::SetValue(DWORD dwValue, LPCTSTR
lpszValueName)
//oRegKey.SetKeyValue(_T("EnableDHCP"),1,NULL);
//CRegKey::SetValue(HKEY hKeyParent, LPCTSTR
lpszKeyName, LPCTSTR lpszValue, LPCTSTR lpszValueName)
//ConfigureDHCP();
}
}
oRegKey.Close();
}
Now i want change the value in the registro from 0 to 1, the compiler dont send me any error, but dont work like i want, what i do wrong?
thanks in advance
Regards
Francisco Morosini
>If boolean value is stored as DWORD value, then you could use another version of QueryValue():
>
>DWORD dwEnableDHCP;
>nJol=oRegKey.Open(hKeyRoot,cRegistro,KEY_QUERY_VALUE);
>if (nJol==0)
>{
> oRegKey.QueryValue(&dwEnableDHCP,_T("EnableDHCP"));
>}
>
>BTW, CRegKey class is included into ATL and described in MSDN.
>
>>Thanks Man!, i fixed!, work, but now i try to read a boolean value and obtain a Assert Error, here is the code:
>>
>>my idea is read the enableDHCP from the card and check the state, in case be 0 turn to 1.
>>
>>please, in this particular case how i can obtain the boolean value?