| |

VerySource

 Forgot password?
 Register
Search
View: 810|Reply: 5

Urgent ~ About the display of the MFC modal dialog box in the main program is closed after the master

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-14 10:20:01
| Show all posts |Read mode
A function in the MFC main program
{
   CShowMsg m_ShowMsg; // CShowMsg is a modal dialog class I created in MFC
   m_ShowMsg.DoModal (); // Show
   WaitForSingleObject (p.hProcess); // Wait for the end of a newly executed process
   m_ShowMsg.EndDialog (); // This function does not work, how to end the dialog at this step!
   AfxMessageBox ("The program has finished running");
}
Of course, the statements after m_ShowMsg.DoModal () cannot be executed;
So I hope to write a detailed code example:
The main function is to run a program in the main program, display a modal dialog box, and then wait for the end of the program to end the dialog box.
Reply

Use magic Report

0

Threads

30

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-1-18 14:45:01
| Show all posts
Why not create a modeless dialog?
CDialog :: Create
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-1-28 17:09:01
| Show all posts
Then there is something wrong with the logic design of your program.
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-30 22:27:01
| Show all posts
Use only modeless dialogs
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-4-9 09:30:02
| Show all posts
If you use a modeless dialog box, can you intercept user actions like a modal dialog box?
If you really only use modeless, can you write a detailed code to achieve the above functions, and I don't know how to map the initialization of the modeless dialog box. Thanks ~
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-7-28 23:15:01
| Show all posts
Don’t you have to end the modal window before you can end other windows? Isn't it enough to use a modeless form?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list