In the following code, RegSetValueEx writes only the first letter of my string. I tried resizing to everything I can think of, and I only get the first row. Any help is appreciated.
LPCWSTR path = L"Test String";
size_t size = wclsen(path) * sizeof(wchar_t);
DWORD dwResult = RegSetValueEx(HKEY_LOCAL_MACHINE,
"SOFTWARE\\My App",
0,
REG_SZ,
(LPBYTE)path,
test);
I tried using path.size () * sizeof (wchar_t) and any number of other sizes that I could think of, but nothing seems to work. Any ideas?
source
share