|
-
June 11th, 1999, 12:14 AM
#1
how can I call a dialog box after application is created, but before user can do anything
I have an SDI application. How can I pop-up a modal dialog box after the application has arisen, but before the user can enter any data? I tried putting the code for a modal dialog box in OnInitDialog() and other places, but the dialog box pops-up too soon, before the application has fully been created.
Any response any one can give me will be greatly appreciated.
-
June 11th, 1999, 12:44 AM
#2
Re: how can I call a dialog box after application is created, but before user can do anything
You can call the modal dialog in InitApplication().
Savitha.
-
June 11th, 1999, 03:39 AM
#3
Re: how can I call a dialog box after application is created, but before user can do anything
Try in the InitialUpdate() of your view class. If this does not work, try this - in the InitialUpdate set a timer that will send a message after half a second, in this message domodal the dialog and kill the timer. Having in mind the InitialUpdate() can be invoked more than once in SDI create a BOOL var that will be set to 1 in the constructor and set to 0 after the dialog has been displayed, put one if(BOOL) so that dialog will be never displayed. I haven't tried this so I do not know if it works. But once I got a similar problem and I was thinking of this way, but finally solved it using threads. I do not think that threads will help you now.
This is just an idea. No advice.
Regards,
-
June 11th, 1999, 04:01 AM
#4
Re: how can I call a dialog box after application is created, but before user can do anything
In InitInstance() member function of your CWinApp derived class,
you can find the lines similar to the following statements
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
Try to insert DoModal() function call just below the 'm_pMainWnd->UpdateWindow()'.
You can make your dialog box pop-up over your main window fully initialized.
Hope this will help you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|