enum switchcase and windows message q
Code:
switch(msg)
{
case WM_Timer:
....
}
the api message labels work fine but when i try to use custom labels i get this error.
Quote:
Error E2172 prog.cpp 768: Duplicate case in function __stdcall ClientProc(HW
ND__ *,unsigned int,unsigned int,long)
Error E2108 prog.cpp 787: Improper use of typedef 'SOCKET' in function __std
call ClientProc(HWND__ *,unsigned int,unsigned int,long)
Error E2379 prog.cpp 787: Statement missing ; in function __stdcall ClientPr
oc(HWND__ *,unsigned int,unsigned int,long)
Error E2134 prog.cpp 893: Compound statement missing } in function __stdcall
ClientProc(HWND__ *,unsigned int,unsigned int,long)
Warning W8070 prog.cpp 893: Function should return a value in function __std
call ClientProc(HWND__ *,unsigned int,unsigned int,long)
*** 4 errors in Compile ***
i checked using the notepad find function there is no duplicate case in the switch case part of the prog.cpp period.
there is no other "case WM_DESTROY:" in the prog.cpp period.
Code:
line 768
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
default: return DefWindowProc(hWnd, Msg, wParam, lParam);
}
however above that there is
Code:
enum { alfaone,
alfatwo,
alfathree,
betaone,
betatwo,
betathree,
....
}
....
switch(LOWORD(wParam))
{
case alfaone:
....
break;
case alfatwo:
....
break;
case alfathree:
....
break;
....
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
default: return DefWindowProc(hWnd, Msg, wParam, lParam);
}
even when i change "enum {alfaone ," to "enum {alfaone = 1 ," i get the same error. Or add "enum checkbox {alfaone = 1 , " i still get the same error.
and when i use -b switch in bcc32 to "treat enum like int" still get same error.
Should i put the custome labels in a seprate switchcase ? like so
Code:
switch(label)
{
case customlabel1:
....
break;
case customlabel2:
....
break;
....
}
i want it to work with the windows message q for checkboxes and other stuff. when ever i try to add custom labels i get the duplicate error.