Click to See Complete Forum and Search --> : Open doesn't use initial child view.


John Hendrix
October 1st, 1999, 01:49 PM
I'm using Visual C++, MFC with an MDI format. When the program first runs, of course, an initial child-window opens up. If I immediately try to load a document (through OPEN FILE, for instance) that initial child-window is not used and just sits there. How can I get my program to act like Word, for example, where that initial blank document is replaced?
Thanks,
John

sstofka
October 1st, 1999, 08:50 PM
If the app has a pointer to the doc you could call OnCloseDocument()in the function that opens up the document you want. Or you could not open a new document when your app starts by modifying InitInstance()after the declaration:
CCommandLineInfo cmdInfo;
insert:
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

Hope this helps!
Steve Stofka

Steve Stofka

peak
October 2nd, 1999, 06:04 AM
I think you can find many useful hints from the article:
http://www.codeguru.com/doc_view/open_most_recent2.shtml



Regards
Peter