Could anyone help?
error C2664: 'RegSetValueExW' : cannot convert parameter 2 from 'char []' to 'LPCWSTR'
#include <windows.h>
#include <stdio.h>
#include <conio.h>
struct {
HKEY hKey;
//unsigned char Names[5] = { "0.Name", "1.Name", "2.Name", "3.Name", "4.Name" };
//unsigned char Scores[5] = { "0.Score", "1.Score", "2.Score", "3.Score", "4.Score" };
} Var;
void OpenKey() {
if (RegOpenKeyEx(Var.hKey_CURRENT_USER, TEXT("Software\\Microsoft\\Plus!\\Pinball\\SpaceCadet")
, 0, KEY_ALL_ACCESS, &Var.hKey) != ERROR_SUCCESS) {
puts("RegOpenKeyEx() Error!");
getch();
exit(0);
}
}
void SetValue(char Key[16], char Value[16]) {
if (RegSetValueEx(Var.hKey, Key, NULL, REG_SZ, Value, strlen(Value)+1) != ERROR_SUCCESS) {
puts("RegSetValueEx() Error!");
getch();
exit(0);
}
}
int main ()
{
OpenKey();
SetValue("0.Name", "Steve");
RegCloseKey (Var.hKey);
getch();
return 0;
}

New Topic/Question
Reply




MultiQuote






|