Code Check.

This is a discussion on Code Check. within the C++ Programming forums, part of the General Programming Boards category; Hey all Im working this project and Im using buttons and they've always givin me this problem could you tell ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    34

    Code Check.

    Hey all Im working this project and Im using buttons and they've always givin me this problem could you tell me whats wrong with the following code. Because even though they are different buttons they show the samething.

    Code:
        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case button_1:
                    switch(HIWORD(wParam))
                    {
                        case BN_CLICKED:
                            win.w_msgbox("Hello","World");
                        break;
                    }
                break;
            }
            break;
            switch(LOWORD(wParam))
            {
                case button_2:
                     switch(HIWORD(wParam))
                    {
                        case BN_CLICKED:
                            win.w_msgbox("World","Hello");
                        break;
                    }
                break;
            }
        break;
    Its Really All up to you.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    You have too many switches.
    Code:
        
    case WM_COMMAND:
       switch(LOWORD(wParam))
       {
          case button_1:
             switch(HIWORD(wParam))
             {
                 case BN_CLICKED:
                     win.w_msgbox("Hello","World");
                     break;
              }
          break;   
           case button_2:
               switch(HIWORD(wParam))
                {
                    case BN_CLICKED:
                       win.w_msgbox("World","Hello");
                       break;
                }
           break;   
        }
           
        break;
    Last edited by Quantum1024; 05-20-2006 at 02:18 AM.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    34
    Dammit i didnt see what actually was wrong... I got that after I changed what i Had before which is what you just posted. I declared different names same number muahaha Im an ediot thanks anyway.
    Its Really All up to you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code Check
    By Dae in forum C++ Programming
    Replies: 12
    Last Post: 01-08-2009, 06:01 PM
  2. HELP!!!!emergency ~expert please help
    By unknowppl in forum C Programming
    Replies: 1
    Last Post: 08-19-2008, 07:35 AM
  3. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Game Programming
    Replies: 0
    Last Post: 10-14-2002, 01:27 PM
  4. << !! Posting Code? Read this First !! >>
    By kermi3 in forum C# Programming
    Replies: 0
    Last Post: 10-14-2002, 01:26 PM
  5. Check my code Please
    By AdioKIP in forum C++ Programming
    Replies: 1
    Last Post: 03-12-2002, 07:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21