[Dev-C++] Problem with RegisterWindowMessage()
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Marc H. <ma...@e-...> - 2002-12-02 13:28:28
|
I have a little problem. I have a header file which I include in my main
file (surprise surprise). In the header I have the following:
const UINT WM_MYMESSAGE = RegisterWindowMessage(_T("some message"));
Right, now in my main WindowProc I have a switch statement like so:
LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message
queue */
break;
/*
And some more message handlers here
more
more
*/
case WM_MYMESSAGE:
/*Do some stuff*/
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
So far so good. Now when I compile I get the following little message:
"case label `WM_MYMESSAGE' does not reduce to an integer constant"
Now, personally, I thought that a "const UINT" was an integer constant, but
clearly g++ disagrees. The funny thing is I have used similar code with VC++
v6 and not had the same problem. Any ideas of how I can convince g++ that
this is the case would be appreciated.
_____________________________
Marc Heiligers
PS. I've had coffee before I wrote this, so I'm pretty sure I'm thinking
straight (for a change).
|