regsetvalueEx write me the key in chinnese
Hi i'm creating regedit rule using qt using the follow code, this code work with codeblocks but not with qt:
1 2 3 4 5
|
string subclave="Hello";
string valor="Anyone";
LPCTSTR _subclave = TEXT("");
LPCTSTR _valor = TEXT("");
long crear = RegSetValueEx(key, _subclave, 0, REG_SZ, (LPBYTE) _valor, strlen(_valor) * sizeof(char));
| |
But show me different errores, i show in this image:
https://i.stack.imgur.com/JDfOz.png
So i do the changes:
1 2 3 4 5
|
string hola="hola";
std::wstring stemp = std::wstring(hola.begin(), hola.end());
LPCWSTR subclave = stemp.c_str();
const char * valor = "hola";
long crear = RegSetValueEx(key, subclave, 0, REG_SZ, (LPBYTE) valor, strlen(valor) * sizeof(char));
| |
But now write me the key in chinnese
https://i.stack.imgur.com/3nCV6.png
Last edited on
Just a guess. Maybe try to use a const wchar_t* for your "valor" variable instead of a const char?
Topic archived. No new replies allowed.