C
CrimeMaster
Hi
i have made a Key under the HKEY_LOCAL_MACHINE\Software\My
Toolbar\Setting.
i have placed some values under the Setting key.
i m trying to access the values under that key and want to map them to
a dialog box ,means they should be visible in their corresponding Edit
controls when i display the dialog.i have used the following code in
OnInitDialog() function to map the values to their corresponding
controls but when the dialog displayed some values are repeatedly shown
in different controls.tell me where i m doing a mistake .
CRegKey regKey;
TCHAR szPath[] = _T("SOFTWARE\\MySpace.com
ToolBar\\Setting");
TCHAR szBuff[1024];
DWORD dwSize=dwSize = sizeof(szBuff)/sizeof(szBuff[0]);
LONG err=regKey.Open(HKEY_LOCAL_MACHINE,szPath);
if (err!=ERROR_SUCCESS)
regKey.Close();
regKey.QueryValue(szBuff, _T("FirstName"), &dwSize);
m_FirstName = szBuff;
regKey.QueryValue(szBuff, _T("LastName"), &dwSize);
m_LastName= szBuff;
regKey.QueryValue(szBuff, _T("PresentAddress"), &dwSize);
m_PresentAddress= szBuff;
regKey.QueryValue(szBuff, _T("PermanentAddress"), &dwSize);
m_PermanentAddress = szBuff;
regKey.QueryValue(szBuff, _T("City"), &dwSize);
m_City= szBuff;
regKey.QueryValue(szBuff, _T("Country"), &dwSize);
m_Country = szBuff;
regKey.QueryValue(szBuff, _T("ZipCode"), &dwSize);
m_Zip= szBuff;
regKey.QueryValue(szBuff, _T("PhoneNo"), &dwSize);
m_Phone=szBuff;
regKey.QueryValue(szBuff, _T("MobileNo"), &dwSize);
m_Mobile = szBuff;
regKey.QueryValue(szBuff, _T("AutofillEmail"), &dwSize);
m_EmailAddress = szBuff;
UpdateData(false);
when the dialog displayed often LastName value from registry is
displayed in the m_PresentAddress and m_PermanentAddress edit
controls.and City Value fron registry id
also displayed in m_Country edit control.in the same way some values
are retrieving from registry and when i try to map them with edit
controls on the Dialog box .why did they are ?
i have made a Key under the HKEY_LOCAL_MACHINE\Software\My
Toolbar\Setting.
i have placed some values under the Setting key.
i m trying to access the values under that key and want to map them to
a dialog box ,means they should be visible in their corresponding Edit
controls when i display the dialog.i have used the following code in
OnInitDialog() function to map the values to their corresponding
controls but when the dialog displayed some values are repeatedly shown
in different controls.tell me where i m doing a mistake .
CRegKey regKey;
TCHAR szPath[] = _T("SOFTWARE\\MySpace.com
ToolBar\\Setting");
TCHAR szBuff[1024];
DWORD dwSize=dwSize = sizeof(szBuff)/sizeof(szBuff[0]);
LONG err=regKey.Open(HKEY_LOCAL_MACHINE,szPath);
if (err!=ERROR_SUCCESS)
regKey.Close();
regKey.QueryValue(szBuff, _T("FirstName"), &dwSize);
m_FirstName = szBuff;
regKey.QueryValue(szBuff, _T("LastName"), &dwSize);
m_LastName= szBuff;
regKey.QueryValue(szBuff, _T("PresentAddress"), &dwSize);
m_PresentAddress= szBuff;
regKey.QueryValue(szBuff, _T("PermanentAddress"), &dwSize);
m_PermanentAddress = szBuff;
regKey.QueryValue(szBuff, _T("City"), &dwSize);
m_City= szBuff;
regKey.QueryValue(szBuff, _T("Country"), &dwSize);
m_Country = szBuff;
regKey.QueryValue(szBuff, _T("ZipCode"), &dwSize);
m_Zip= szBuff;
regKey.QueryValue(szBuff, _T("PhoneNo"), &dwSize);
m_Phone=szBuff;
regKey.QueryValue(szBuff, _T("MobileNo"), &dwSize);
m_Mobile = szBuff;
regKey.QueryValue(szBuff, _T("AutofillEmail"), &dwSize);
m_EmailAddress = szBuff;
UpdateData(false);
when the dialog displayed often LastName value from registry is
displayed in the m_PresentAddress and m_PermanentAddress edit
controls.and City Value fron registry id
also displayed in m_Country edit control.in the same way some values
are retrieving from registry and when i try to map them with edit
controls on the Dialog box .why did they are ?