
Creating MDI child manually
Quote:
> But there is only one CChildFrm class, so are all those MDI childs just
instances
> of the CChildFrm class?
Yes
Quote:
> When I click on the button for graphics, an MDI
> window will open and display some images, while clicking the other
> button opens a new MDI window and have some text display in there.
You would need to have a doctemplate for each type of view(graphics/text).
Then in the handler of your toolbar buttons, you would use the appropriate
doctemplate to call CreateNewFrame.
--
Ajay Kalra [MVP - VC++]
Quote:
> Hi,
> I'm new to MFC and is still trying to grasp the Doc/View concept. I
> have created an MDI app through the AppWizard in VC++ 6.0 (SP 5). When
> I run the program and click on the "New" button, a new MDI child
> window gets created. It seems that the code is hidden away and I
> can't get to it.
> My question is: How do I create the MDI child manually, through code.
> I understand that you do this through the CreateNewFrame() function.
> What I'm also not clear on is that by clicking on the "New" button
> that many times generate that many MDI child windows. But there is
> only one CChildFrm class, so are all those MDI childs just instances
> of the CChildFrm class?
> What I am trying to do is just create two buttons on the tool bar,
> let's say one button is to display some graphics, the other button to
> display some text. When I click on the button for graphics, an MDI
> window will open and display some images, while clicking the other
> button opens a new MDI window and have some text display in there.
> Do I need to create new classes and derive them from CDocument and
> CView to hold the actual data (the graphics and texts) that I am going
> to display?
> Any help would be appreciated.
> Steven