Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Ok so I've currently been working on a debugger, and I've created a button that is suppose to execute commands in a debugger. But it doesn't do it correctly no matter what I do, here is the code for the two cases.
C++
case Execute_Button:
    INPUT_FIELD;
    break;
case INPUT_FIELD:
    if (HIWORD(wParam) == EN_MAXTEXT) {
        char cText[INPUT_CHAR_LIMIT];
        SendMessage((HWND)lParam, WM_GETTEXT, INPUT_CHAR_LIMIT, (LPARAM)cText);

        if (strcmp(cText, "") == 0)
            break;

        SendMessage((HWND)lParam, WM_SETTEXT, NULL, (LPARAM)"");

        //std::string command = cText;
        HandleCommand(cText);
    }

    break;
}
break;

Any help? I honestly do not know what to do.

What I have tried:

Calling the case Input_Field from the execute button.
Posted
Updated 22-Oct-16 21:08pm
Comments
Richard MacCutchan 23-Oct-16 2:51am    

case Execute_Button:
INPUT_FIELD;
break;

What is that supposed to do?

1 solution

You cannot call a case statement.
However, you can let it fall through.
C++
case Execute_Button:
    // INPUT_FIELD;
    // break;
case INPUT_FIELD:
    if (HIWORD(wParam) == EN_MAXTEXT) {
        char cText[INPUT_CHAR_LIMIT];
        SendMessage((HWND)lParam, WM_GETTEXT, INPUT_CHAR_LIMIT, (LPARAM)cText);
 
        if (strcmp(cText, "") == 0)
            break;
 
        SendMessage((HWND)lParam, WM_SETTEXT, NULL, (LPARAM)"");
 
        //std::string command = cText;
        HandleCommand(cText);
    }
 
    break;
}
break
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900