C++: Getting registry value only gives first character [duplicate]
问题 This question already has answers here : C++ - getting null values in value read from registry (2 answers) RegSetValueEx Only shows writes first character (2 answers) c++ get registry key returns only one char (1 answer) Closed 2 years ago . I'm trying to get a string value from the registry, but I'm only getting the first letter. HKEY hKey; char gamePath[MAX_PATH]; if(RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\Blizzard Entertainment\\Warcraft III",0,KEY_READ,&hKey) == ERROR_SUCCESS) { DWORD