I posted the relevant code below. Here's the line that has a problem:
...
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
if ((ISPRESSED_PLAY_BUTTON(xPos,yPos)) && (PLAY_BUTTON_STATE==2)) {
If in place of ==2, I put ==BUTTON_CLICKED, it yields a bunch of errors:
MPlayer.cpp(270): error C2143: syntax error : missing ')' before ';'
MPlayer.cpp(270): error C2143: syntax error : missing ')' before ';'
MPlayer.cpp(270): error C2059: syntax error : ')'
MPlayer.cpp(270): error C2059: syntax error : ')'
MPlayer.cpp(270): warning C4390: ';' : empty controlled statement found; is this the intent?
Why? BUTTON_CLICKED is equal to 2, so it should be just fine, right? Just putting 2, it will compile and my program works just as expected. It would be nice if I could use the BUTTON_CLICKED name instead of 2, though, so I know what's going on. Is using a BYTE type wrong for this purpose? I just need a couple of states, and since a byte has 256 states, I thought it would be perfectly adequate versus some of the bigger short and integer types.
It doesn't work this way either:
if (PLAY_BUTTON_STATE==BUTTON_CLICKED)
...
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
if ((ISPRESSED_PLAY_BUTTON(xPos,yPos)) && (PLAY_BUTTON_STATE==2)) {
If in place of ==2, I put ==BUTTON_CLICKED, it yields a bunch of errors:
MPlayer.cpp(270): error C2143: syntax error : missing ')' before ';'
MPlayer.cpp(270): error C2143: syntax error : missing ')' before ';'
MPlayer.cpp(270): error C2059: syntax error : ')'
MPlayer.cpp(270): error C2059: syntax error : ')'
MPlayer.cpp(270): warning C4390: ';' : empty controlled statement found; is this the intent?
Why? BUTTON_CLICKED is equal to 2, so it should be just fine, right? Just putting 2, it will compile and my program works just as expected. It would be nice if I could use the BUTTON_CLICKED name instead of 2, though, so I know what's going on. Is using a BYTE type wrong for this purpose? I just need a couple of states, and since a byte has 256 states, I thought it would be perfectly adequate versus some of the bigger short and integer types.
It doesn't work this way either:
if (PLAY_BUTTON_STATE==BUTTON_CLICKED)