I am trying to get the data of a registry key value, but then I encountered this error,
[bcc64 Error] AAP.h(210): invalid operands to binary expression ('const wchar_t *' and 'const wchar_t *') (also on this screenshot)
I'm pretty sure I did something wrong, or didn't do properly, (I'm new to c++)
HKEY currentKey;
TCHAR name[256];
String loly;
void fivenum()
{
DWORD dwSize = 1024;
DWORD dwIdx = 0;
long result = 0;
long fivenumberresult = 0;
result = RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft"), 0, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE | KEY_SET_VALUE, ¤tKey);
if(result != ERROR_SUCCESS)
{
// fail
}
else
{
DWORD indexs = 0;
fivenumberresult = RegEnumKeyEx(currentKey, indexs, name, &dwSize, NULL, NULL, NULL, NULL);
if(!fivenumberresult)
{
std::wstringstream box_message;
loly = box_message.str().c_str();
}
}
}
String awit;
void reg4()
{
HKEY hKey = 0;
wchar_t buf[255];
DWORD dwBufSize = sizeof(buf);
awit = _D("");
const wchar_t* xds = loly.w_str();
const wchar_t* xd = L"Software\\Microsoft\\" + xds;
if( RegOpenKeyExW(HKEY_CURRENT_USER,xd,0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS)
{
if(RegQueryValueExW(hKey,L"14770",0, 0, (BYTE*)buf, &dwBufSize) == ERROR_SUCCESS)
{
std::wstringstream box_messagess;
for(DWORD i = 0; i < dwBufSize; ++i)
{
box_messagess << IntToHex(static_cast<int>(buf[i]), 2).c_str() << _D(",");
}
awit = box_messagess.str().c_str();
}
}
}