Now, this functions wants a LPCWSTR in unicode (the magic L)
Code: Select all
//Open registry key
retVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCWSTR)L"SYSTEM\\some\\path", 0, KEY_READ, &phkResult);
Code: Select all
//Open registry key
retVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, regKey, 0, KEY_READ, &phkResult);
I have one variable
Code: Select all
LPCWSTR test = L"SYSTEM\\CurrentControlSet\\services\\Tcpip\\Parameters\\Interfaces\\";
Code: Select all
char *test2= pAddresses->AdapterName;
But for some reason I simply can't get this to work. It works if I use wstring and wsstream to stream them back to a wstring, then assign it with to a LPCWSTR and use it, but if I put that same code in a function and return it, it doesn't work anymore.
Does anyone have an idea?