Click here to Skip to main content
16,011,647 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: just a question... Pin
Todd Smith5-Aug-01 16:14
Todd Smith5-Aug-01 16:14 
GeneralRe: just a question... Pin
Kuniva5-Aug-01 22:41
Kuniva5-Aug-01 22:41 
GeneralStrings Pin
Peter Liddle5-Aug-01 4:45
Peter Liddle5-Aug-01 4:45 
GeneralRe: Strings Pin
Paolo Messina5-Aug-01 5:58
professionalPaolo Messina5-Aug-01 5:58 
GeneralMFC doc/view Pin
Wim Jans5-Aug-01 4:08
Wim Jans5-Aug-01 4:08 
GeneralRe: MFC doc/view Pin
Frank Deo5-Aug-01 4:24
Frank Deo5-Aug-01 4:24 
GeneralRe: MFC doc/view Pin
Michael Dunn5-Aug-01 8:16
sitebuilderMichael Dunn5-Aug-01 8:16 
GeneralRe: MFC doc/view Pin
Wim Jans5-Aug-01 11:05
Wim Jans5-Aug-01 11:05 
Thanks, but this doesn't work like I want it to work.

What I want is: when I choose File/new... (ctrl-n) a dialog is displayed before my mdi child window is displayed. If I close the dialog by pressing cancel, I don't want to see the child window at all. The other document child windows should sill be open however.

I tried to show the dialog in CMyView::OnCreate, but if I try to do AfxGetMainWnd()->PostMessage , I get an debug error.
Is AfxGetMainWnd()->PostMessage ( WM_CLOSE ); not closing the complete application by the way?

After that, I tried to put the code in CMyView::OnInitialUpdate, but then he already displayed my child window before showing my dialog -even if I put CView::OnInitialUpdate at the end.

I think overriding CMyView::OnCreate is perfect (with my basic knowledge so far) for what I want to do, but how can I say: ok, forget about creating this new document, I just don't have enough information. If I return -1 in OnCreate, he will complain about Failed to create empty document'.

As suggested by Frank, I tried to override the OnFileNew in my view class, but this doesn't work if I currently have no open documents. I did this by putting cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;.

Sorry if my explanation is a bit vague, but I'm not a native English speaker.

Thanks for your time.

Wim Jans





GeneralRe: MFC doc/view Pin
Frank Deo5-Aug-01 12:38
Frank Deo5-Aug-01 12:38 
GeneralRe: MFC doc/view Pin
Wim Jans5-Aug-01 21:21
Wim Jans5-Aug-01 21:21 
Generalfinding a string in a CString Pin
5-Aug-01 3:02
suss5-Aug-01 3:02 
GeneralRe: finding a string in a CString Pin
Steve Maier5-Aug-01 3:47
professionalSteve Maier5-Aug-01 3:47 
GeneralRe: finding a string in a CString Pin
Baafie5-Aug-01 3:51
Baafie5-Aug-01 3:51 
GeneralRe: finding a string in a CString Pin
Baafie5-Aug-01 3:51
Baafie5-Aug-01 3:51 
GeneralRe: finding a string in a CString Pin
#realJSOP5-Aug-01 5:02
professional#realJSOP5-Aug-01 5:02 
GeneralRemoving Help button from Wizard Pin
4-Aug-01 20:53
suss4-Aug-01 20:53 
GeneralRe: Removing Help button from Wizard Pin
Bill Leibold4-Aug-01 21:30
Bill Leibold4-Aug-01 21:30 
GeneralRe: Removing Help button from Wizard Pin
Paolo Messina5-Aug-01 5:54
professionalPaolo Messina5-Aug-01 5:54 
GeneralMaintaining Referential Integrity Pin
Reno Tiko4-Aug-01 15:37
Reno Tiko4-Aug-01 15:37 
GeneralUsing CTabCtrl Effectivelty Pin
AJ1234-Aug-01 12:11
AJ1234-Aug-01 12:11 
QuestionWhat's the difference? Pin
4-Aug-01 10:21
suss4-Aug-01 10:21 
AnswerRe: What's the difference? Pin
Chris Losinger4-Aug-01 10:26
professionalChris Losinger4-Aug-01 10:26 
GeneralRe: What's the difference? Pin
4-Aug-01 10:32
suss4-Aug-01 10:32 
GeneralRe: What's the difference? Pin
Christian Graus4-Aug-01 11:39
protectorChristian Graus4-Aug-01 11:39 
GeneralRe: What's the difference? Pin
Ben Burnett4-Aug-01 11:40
Ben Burnett4-Aug-01 11:40 

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.