CMyFrame
is a CFrameWnd
created with class wizard
CMyView
is a CFormView
created with the class wizard
I want CMyFrame to always incorporate CMyView as the view. Make sure MyFrame.cpp includes MyView.h
bool CMyFrame::LoadFrame(..., CCreateContext* pContext)
{
CCreateContext ctxt;
if (pContext == 0)
{
ctxt.m_pNewViewClass = RUNTIME_CLASS(CMyView);
pContext = &ctxt;
}
if (CFrameWnd::LoadFrame... (the rest is created by the wizard)
}