Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalis this a clue? Pin
ns26-Mar-03 9:25
ns26-Mar-03 9:25 
GeneralRe: is this a clue? Pin
Ravi Bhavnani26-Mar-03 9:31
professionalRavi Bhavnani26-Mar-03 9:31 
GeneralRe: is this a clue? Pin
ns26-Mar-03 9:42
ns26-Mar-03 9:42 
GeneralRe: is this a clue? Pin
Tim Smith26-Mar-03 9:53
Tim Smith26-Mar-03 9:53 
GeneralRe: is this a clue? Pin
Ravi Bhavnani26-Mar-03 10:00
professionalRavi Bhavnani26-Mar-03 10:00 
GeneralRe: is this a clue? Pin
ns27-Mar-03 1:51
ns27-Mar-03 1:51 
Generalno go... Pin
ns27-Mar-03 2:25
ns27-Mar-03 2:25 
GeneralRe: is this a clue? Pin
Ravi Bhavnani27-Mar-03 2:52
professionalRavi Bhavnani27-Mar-03 2:52 
You know naathing? Sorry, I don't buy that! Smile | :)

You wrote:
SO if I launch the modal dlg then send a messsage to the view to do the lengthy stuff, then call OnCancel once back in the modal dlg?

Not quite. When you launch the modal dialog from the view, give it a pointer to the data that belongs to the view. That way it (the dialog) can happily do all the initialization and if you like, even display progress and allow the user to cancel.

When the initialization completes, the dialog ends itself (by calling CDialog::OnOK()). If an error occured, it can end itself by calling CDialog::OnOK(). That way the view knows what happened.

It's possible that the view isn't completely setup until after it finishes executing OnInitialUpdate(). If this is the case, just have OnInitialUpdate() post a fake command (IDC_DO_INIT) to itself, and do the modal dialog thing in that command's handler. If the init fails, you can programmatically close the view after displaying an informational message.

Hope this helps.

/ravi

Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
GeneralRe: is this a clue? Pin
ns27-Mar-03 3:25
ns27-Mar-03 3:25 
GeneralRe: is this a clue? Pin
Ravi Bhavnani27-Mar-03 5:42
professionalRavi Bhavnani27-Mar-03 5:42 
Generalso ques is: Pin
ns27-Mar-03 6:52
ns27-Mar-03 6:52 
GeneralRe: so ques is: Pin
Ravi Bhavnani27-Mar-03 7:13
professionalRavi Bhavnani27-Mar-03 7:13 
GeneralRe: so ques is: Pin
ns27-Mar-03 7:23
ns27-Mar-03 7:23 
GeneralReally bizarre but resolved (though no see CDlg) Pin
ns27-Mar-03 7:27
ns27-Mar-03 7:27 
GeneralRe: so ques is: Pin
ns27-Mar-03 7:56
ns27-Mar-03 7:56 
GeneralRe: so ques is: Pin
Ravi Bhavnani27-Mar-03 8:42
professionalRavi Bhavnani27-Mar-03 8:42 
GeneralEmbedded Excel Pin
act_x26-Mar-03 8:30
act_x26-Mar-03 8:30 
GeneralRe: Embedded Excel Pin
François Gasnier26-Mar-03 10:32
François Gasnier26-Mar-03 10:32 
GeneralRe: Embedded Excel Pin
act_x26-Mar-03 11:10
act_x26-Mar-03 11:10 
GeneralRegex++ causes abnormal program termination Pin
annum26-Mar-03 8:25
annum26-Mar-03 8:25 
GeneralRe: Regex++ causes abnormal program termination Pin
Dave Bryant26-Mar-03 9:12
Dave Bryant26-Mar-03 9:12 
GeneralRe: Regex++ causes abnormal program termination Pin
Steve Mayfield26-Mar-03 9:34
Steve Mayfield26-Mar-03 9:34 
GeneralRe: Regex++ causes abnormal program termination Pin
annum26-Mar-03 14:54
annum26-Mar-03 14:54 
Generalsetting the "break on unhandled exceptions" Pin
ns26-Mar-03 8:25
ns26-Mar-03 8:25 
GeneralRe: setting the "break on unhandled exceptions" Pin
Chris Losinger26-Mar-03 8:47
professionalChris Losinger26-Mar-03 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.