Hello, I can usually do a check by doing an if:
static const wchar_t *example=L"myprogram";
if (!lstrcmpW(((LVITEMW*)lparam)->pszText, example))//The lparam is a LVITEM* struct.
{
return 0;
}
But now I wanted to try to do it from a switch case ..:
switch ( ((LVITEMW*)lparam)->pszText ) {
case L"pro.exe": // Note the colon, not a semicolon
return 0;
break;
default:
break;
}
However I get the following errors:
dllmain.cpp:29:40: error: switch quantity not an integer
switch ( ((LVITEMW*)lparam)->pszText ) {
^
:30:10: error: could not convert '"pstatic const wchar_t *example=L"myprogram";
if (!lstrcmpW(((LVITEMW*)lparam)->pszText, example))//The lparam is a LVITEM* struct.
{
return 0;
}
0rswitch ( ((LVITEMW*)lparam)->pszText ) {
case L"pro.exe": // Note the colon, not a semicolon
return 0;
break;
default:
break;
}
0odllmain.cpp:29:40: error: switch quantity not an integer
switch ( ((LVITEMW*)lparam)->pszText ) {
^
:30:10: error: could not convert '"p%pre%0r%pre%0o%pre%0.%pre%0e%pre%0x%pre%0e%pre%0%pre%0"' from 'const wchar_t [8]' to '<type error>'
case L"pro.exe": // Note the colon, not a semicolon
0.%pre%0e%pre%0x%pre%0e%pre%0%pre%0"' from 'const wchar_t [8]' to '<type error>'
case L"pro.exe": // Note the colon, not a semicolon
What am I doing wrong?
The problem esque has to be a wchar_t because ((LVITEMW*)lparam)->pszText )
will be a wchar_t.