I googled it for 2 hours now, and i can't find an answer for my problem: i need to get a registry REG_SZ value and pass it to a char*.
char host_val[1024]; DWORD hostVal_size = 1024; char* hostName; DWORD dwType = REG_SZ; RegOpenKeyEx(//no problem here); if( RegQueryValueEx( hKey, TEXT("HostName"), 0, &dwType, (LPBYTE)&host_val, &hostVal_size ) == ERROR_SUCCESS ) { //hostName = host_val; } How should i do this conversion hostName = host_val?