|
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. |
|