Click to See Complete Forum and Search --> : 2nd 'Main' Frame
George
October 1st, 1999, 04:28 AM
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
zcl
October 1st, 1999, 06:21 AM
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.
Jason Teagle
October 1st, 1999, 06:50 AM
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 (jteagle@geocities.com).
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.