CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 1999
    Posts
    2

    Open doesn't use initial child view.

    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


  2. #2
    Join Date
    Sep 1999
    Location
    Colorado, USA
    Posts
    1,002

    Re: Open doesn't use initial child view.

    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

  3. #3
    Join Date
    Aug 1999
    Posts
    19

    Re: Open doesn't use initial child view.

    I think you can find many useful hints from the article:
    http://www.codeguru.com/doc_view/ope..._recent2.shtml



    Regards
    Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured