/*Function: get the specified value of regedit key
_strKey: Pointer to a null-terminated string containing the name of the subkey to open
_strValue: Pointer to a null-terminated string containing the name of the value to query
Return : Pointer to a buffer that receives the value's data.
This parameter can be NULL if the data is not required
*/
CString CMainFrame::GetRetailPath(CString _strKey, CString _strValue)
{
HKEY hKey;
TCHAR szSupplyPath[256];
DWORD dwBufferLen = 256;
LONG lRet;
_strKey,
0,
KEY_QUERY_VALUE,
&hKey) != ERROR_SUCCESS)
lRet = ::RegQueryValueEx(hKey,
_strValue,
NULL,
NULL,
(LPBYTE)szSupplyPath,
&dwBufferLen);
RegCloseKey(hKey);
}
if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, return _T( "" ); return szSupplyPath;