?
Solved

display a dialog box within a dialog application

Posted on 2000-01-16
7
Medium Priority
?
270 Views
Last Modified: 2010-04-01
I have a program which displays a dialog box (dialog based program),
After the program displays a dialog box with a message 'hello 123',the user might click Ok to see another dialog box... then the second dialog box is shown for 5 seconds then a third dislog appears... what approach can I use to accomplish this? The background is stimulated to use outlook express...

Thanks
Jacky
0
Comment
Question by:whluk
  • 4
  • 3
7 Comments
 

Accepted Solution

by:
Toronado earned 200 total points
ID: 2358681
Hi whluk,

If I understand the question right, try the following.

You can set up a timer which will call the OnOk function of the active dialog.
Than it will disapear after some time and when the user clicks OK.
The only thing you have to do is to setup a list of DoModal () calls in the InitInstance function of the main program.

BOOL CProgrammerApp::InitInstance()
{
 // Some code.

 CProgrammerDlg dlg, dlg2;
 m_pMainWnd = &dlg;

 if (dlg.DoModal() == IDOK)
 {
  m_pMainWnd = &dlg2;
  if (dlg2.DoModal() == IDOK)
  {
   // ect.
  }
 }
 else
 {
 }
}

You should make a better piece of code for this, but the idea should work.

Success,
 Toronado.
0
 

Author Comment

by:whluk
ID: 2358693
I have been thinking about writing a script file that runs 3 individual dialog based application to stimulate the mentioned effect. How do I create script to run C++ or other exe programs

Thx
Jacky
0
 

Author Comment

by:whluk
ID: 2358710
sorry, toronado
can you also show me the timer code?..
as I don't quite understand...

Thx
Jacky
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Author Comment

by:whluk
ID: 2358713
it would be better off for me to show the complete source coding... sorry, do I expect too much?
Thx
Jacky
0
 

Expert Comment

by:Toronado
ID: 2358762
Hi whluk,

Timer code :

Call SetTimer (1, 5000, NULL); in your InitDialog function.
Also add ON_WM_TIMER()to the messagemap and the void OnTimer(UINT nIDEvent)memberfunction to your dialogclass.

The OnTimer function will be called after 5 secconds. In this function call the OnOk () or EndDialog (). The dialog will disapear.

By the way, is this in fact the same question as "related to last question on buttons"? I saw that Zoppo has the same solution on the other question.

May be we should switch to one question.

Regards,
 Toronado.
0
 

Author Comment

by:whluk
ID: 2359286
Will it cause any problems if I want to change the size, typeface and color of the text in the dialog boxes? And How?

0
 

Expert Comment

by:Toronado
ID: 2359321
Hi whluk,

What's on the dialog doesn't affect the behaviour of the dialog itself.

Toronado
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question