CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Location
    Cambridge University, U.K.
    Posts
    10

    2nd 'Main' Frame

    Does anyone know how to spawn secondary (but different) MainFrames from the primary one? I'm looking for behaviour like Outlook Express (i.e. select a mail and a new window pops up). I need the functionality of the MainFrame (i.e. toolbars, splitters, scrollbars, menus etc) and for the new window to appear on the taskbar.

    I'm currently doing this by using modeless dialog boxes (with the desktop as parent) and implementing the toolbars etc by hand which seems excessive!

    Cheers,

    George


  2. #2
    Join Date
    Oct 1999
    Posts
    7

    Re: 2nd 'Main' Frame

    Why?
    you can create a new framewnd class derived from CFrameWnd or CMDIFrameWnd, and create its instance,then show it.
    It looks quite like the creation of the main frame,except assigning value to m_pMainWnd.



  3. #3
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: 2nd 'Main' Frame

    Add the template for the new frame / view / doc you want (but don't call AddDocTemplate(), save the pointer in your app manually instead). Then, simply call CreateNewFrame() and InitialUpdateFrame() from this second (single) doc template. Don't forget to maintain a list of these other frames, so that they can be destroyed if the main frame is destroyed (and remove them from the list if they are closed themselves).

    If I summarised that too much, e-mail me ([email protected]).



    --
    Jason Teagle
    [email protected]

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