What is the return value of the MFC dialog box?

Updated on technology 2024-05-10
13 answers
  1. Anonymous users2024-02-10

    Unless you overload the domodal function, the return value can only be the standard two.

    In fact, it makes no sense to modify this rebate value by using the modal dialog box that domodal pops up, because after domodal returns, you can still access the member variables of the mydlg dialog class (note, do not use interface-related control variables) to get the data, as long as you are in the onok function of mydlg (or other member functions can also be used), assign the value to a custom class member variable, and domodal can get the actual assignment after that.

  2. Anonymous users2024-02-09

    Add the following to the button's message handler

    onbutton1()

    getdlgitem(idc_button2)->enablewindow(false);Button 1 is made unavailable when button 1 is clicked (gray).

    Multiple buttons can also be implemented with reference to this **, to make the button available again, use getdlgitem(idc button2)->enablewindow(true);

  3. Anonymous users2024-02-08

    int rlt = ;

    if(idok == rlt)

    OK the button is pressed, do something? }

    if(idcancel == rlt)

    The cancel button is pressed, what to do?

    The return value of the dialog box identifies the reason why the dialog box exited.

  4. Anonymous users2024-02-07

    Normally cdialog::d omodal() is to call the window, if you need to return a value, usually idok, to determine whether the current window is determined, in fact, msdn is the best teacher, all of the above.

  5. Anonymous users2024-02-06

    Generally speaking, modal dialogs call cdialog::enddialog(int); The end.

    onok() generated by template; and oncancel(); corresponding to enddialog(idok); and enddialog(idcancel);

    The following is the definition of the end code of the general dialog box, and the corresponding meaning can be seen in English.

    #define idok 1

    #define idcancel 2

    #define idabort 3

    #define idretry 4

    #define idignore 5

    #define idyes 6

    #define idno 7

    #if(winver >=0x0400)

    #define idclose 8

    #define idhelp 9

    endif *winver >=0x0400 * You can also define your own end code, and then the function that calls the dialog will determine the result.

  6. Anonymous users2024-02-05

    It depends on what you're doing with it.

    To get this value, you can use a judgment statement to determine the value of this bb, and then perform related operations, if you want to see the value of bb, you can use a messagebox to pop it.

  7. Anonymous users2024-02-04

    Here you go :

    int bb=3;

    test addtest;

    int ret=;See what the ret return value isif(idok == ret).

    else

  8. Anonymous users2024-02-03

    What is returned is the ID of the button on the pop-up dialog you clicked.

    For example, if you click the cancel button on the pop-up dialog box, the ID of the button is idcancel, and the return value is idcancel

  9. Anonymous users2024-02-02

    Look up MSDN.

    The main ones are as follows:

    1 The dialog box was not created successfully.

    IDABRAT: Click "ABORT" and press "OK".

    idcancel click the "Cancel" button.

  10. Anonymous users2024-02-01

    As mentioned upstairs, commonly used: idok, idcancel

  11. Anonymous users2024-01-31

    You can define a global variable a, let a = your string, and then your parent window is free to use the string a.

  12. Anonymous users2024-01-30

    Add the function of get data to the dialog box where the button is located, and the return value is cstring, and you can call the member function of this class in the tab tag to get the return value.

  13. Anonymous users2024-01-29

    It's okay if the function type isn't void, and it has nothing to do with whether it's MFC or not.

Related questions
12 answers2024-05-10

How can I use getdlgitem and getdc before the dialog box is created? >>>More

8 answers2024-05-10

find is used to find other text strings.

within text) and returns the starting position number of find text, starting with the first character of within text. You can also use search to find a text string in other text strings, but, unlike search, find is case-sensitive and doesn't allow wildcards. >>>More

8 answers2024-05-10

If the main function does not end with a return statement, C specifies that the compiler will automatically add a return to the generated object file to indicate that the program exits normally. However, I would suggest that you add a return statement to the end of the main function, about void main In C and C++, the prototype of the function that does not receive any arguments and does not return any information is "void foo(void); Probably because of this, many people mistakenly think that if the program doesn't need to return any information, they can define the main function as void main(void). However, this is wrong! >>>More

13 answers2024-05-10

The formula in the expression is incorrect.

12 answers2024-05-10

Virus. Just kill the virus.