Search code examples
c++mfcmdimdichild

How do i call a FormView in a ChildForm in MFC C++ MDI Application


As the tittle says

How i can call a FormView to a ChildForm? in MDI App?

I have seen a lot of answer for C# and others languages but i'm programming with MFC C++ and nobody has answered this question yet(only about MainFrame for SDI)

Basically this is the body of question:

  • How i can apply my FormView into a ChildFrame(CMDIChildWnd)?

Solution

  • As CFormView is derived from CScrollView, I don't see a problem here, if your replace the CView of the MDI with CFormView.

    One uncomely thing is of course the fixed size of the controls in the variable frame, which is not an overly elegant design and makes CFormView a bit dated in my opinion. MFC is a rather old architecture and thus a variable handling of dialog controls is nothing you get out of the box, but in past projects, I found ResizableLib handy to overcome the fixed layout. There is a CResizableMDIChild class you can use. This is still not as elegant and easy to use as in WPF or Windows Forms, but it works.