Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I start a function in a modal dialog

Status
Not open for further replies.

milner

Programmer
Apr 15, 1999
28
0
0
CA
I have a function that does a process. I want the process to start immediately when my Modal Dialog is activated. I tried putting it in OnInitDialog, but the dialog doesn't appear until after my process is complete! I want the dialog to show on screen, THEN my process to begin.

Thanks for the help,

Mike
 
do it in OnCommand John Fill
1c.bmp


ivfmd@mail.md
 
I put it in there but it still will only run if the user clicks on something to generate a message. Is there any way to have it start automatically?
 
The dialog will not be displayed until the process ends i.e. the dialog drawing will be done after the end of the process no matter if you put the function in OnInitDialog, OnCreate,... To achieve your goal you must create a second thread and place your function in it and call the thread in OnInitDialog. In this way your dialog will be displayed while the process is being done but you should make sure to properly synchronize the threads so that the dialog is not accessible until the thread is finished. A.Gh(ntbutic)
ntbutic@hotmail.com
 
..no I understood what do you mean. Execute this function in a separate thread. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top