ComboBox Notification Problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fromethius
    New Member
    • Apr 2007
    • 38

    ComboBox Notification Problems

    Hello everyone and thank you for taking the time to read my post,

    I have this code:

    Code:
            case WM_COMMAND:
               {
                  switch(LOWORD(wParam))
                  {
                     case hwndCombo:
                     {
                        switch(HIWORD(wParam))
                        {
                           case CBN_DROPDOWN:
                           {
                              MessageBox(hwnd, "OK", "OK", MB_OK);
                           } break;
                        } break;
                     } break;
                  } break;
               } break;
    Also, I have hwndCombo initialized right after I create my window. Don't worry, I know it is initialized before WM_COMMAND runs:

    Code:
    wndCombo = GetDlgItem(hwnd, 30000);
    My combobox resource is defined as 30000.





    Anyways, when I try to compile this code I get this error:

    Code:
    `hwndCombo' cannot appear in a constant-expression
    Thanks for any help given.
  • Fromethius
    New Member
    • Apr 2007
    • 38

    #2
    Can I get any help on this one?

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      hwndCombo is being used as a case in a switch statement. Cases must be constant integer values.

      Comment

      Working...