Original Post
I''m just wondering why I need braces around this code or MSVC won''t compile it:
So, why are does their have to be curly braces in that WM_CREATE case? I can''t see how scope would matter in that problem. Is it how Windows defined WM_CREATE?
Just a question that''s been bothering me for a while.
// The main window message handler
LRESULT CALLBACK WndProc(HWND hWnd, // The application''s window handle
UINT message, // The message to be processed
WPARAM wParam, // More information about the message
LPARAM lParam) // More information about the message
{
// Get the Window context
GLWindow* window = (GLWindow*)(GetWindowLong(hWnd, GWL_USERDATA));
// Handle the message
switch(message)
{
// When the window is being created
case WM_CREATE:
{
// Store the Window context
CREATESTRUCT* creation = (CREATESTRUCT*)(lParam);
window = (GLWindow*)(creation->lpCreateParams);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)(window));
}
return FALSE;
break;
..........
|