如何使按钮执行另一个案例。 [英] How do I make a button execute another case.

查看:110
本文介绍了如何使按钮执行另一个案例。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我目前一直在研究调试器,我创建了一个假设在调试器中执行命令的按钮。但无论我做什么都不能正确执行,这里是两种情况的代码。

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.

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;



有什么帮助吗?老实说,我不知道该怎么做。



我尝试过:



从执行按钮调用案例Input_Field。


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

What I have tried:

Calling the case Input_Field from the execute button.

推荐答案

你不能调用案例陈述。

但是,你可以让它通过。

You cannot call a case statement.
However, you can let it fall through.
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


这篇关于如何使按钮执行另一个案例。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆