Writting to registry failling
Code:
bool WriteRegStr(HKEY hKey, const char *lpszSubKey, const char *lpszValueName, const char *lpData)
{
HKEY hkey;
if (RegOpenKeyEx(hKey, lpszSubKey, 0, KEY_ALL_ACCESS, &hkey) != ERROR_SUCCESS) return false;
{
if (RegSetValueEx(hKey, lpszValueName, 0, REG_SZ, LPBYTE(lpData), lstrlen(lpData)+1) != ERROR_SUCCESS) return false;
RegCloseKey(hkey);
return true;
}
return false;
}
WriteRegStr(HKEY_CURRENT_USER, "Software\\Joel", "temp", "boom");
I'm attempting to update temp but it doesn't do the job, any ideas?