Discussion:
CFrameWnd->GetActiveView() Fails
(too old to reply)
AVee
2007-06-20 21:54:31 UTC
Permalink
How does the CFrameWnd->m_pActiveView member function get attached? I am
creating a CFrameWnd object with CRuntimeClass->CreateObject(), and passing
it a my RUNTIME_CLASS( myViewClass) View class in the
CCreateContext->m_pNewViewClass member when I pass the CreateContext argument
to LoadFrame(). Everything works fine when run ActivateFrame(), View and
Frame functioning normally. However, when I call CFrameWnd->GetActiveView(),
which only returns its member m_pActiveView, it returns NULL. Tracing
through MFC source, I noticed that when the View object is created, it
doesn't get saved to CFrameWnd->m_pActiveView. So, my question - How might I
attach the View to the Frame?
Mark Salsbery
2007-06-21 00:17:38 UTC
Permalink
Try calling CFrameWnd::InitialUpdateFrame() after creating/loading the frame
window.

Mark
Post by AVee
How does the CFrameWnd->m_pActiveView member function get attached? I am
creating a CFrameWnd object with CRuntimeClass->CreateObject(), and passing
it a my RUNTIME_CLASS( myViewClass) View class in the
CCreateContext->m_pNewViewClass member when I pass the CreateContext argument
to LoadFrame(). Everything works fine when run ActivateFrame(), View and
Frame functioning normally. However, when I call CFrameWnd->GetActiveView(),
which only returns its member m_pActiveView, it returns NULL. Tracing
through MFC source, I noticed that when the View object is created, it
doesn't get saved to CFrameWnd->m_pActiveView. So, my question - How might I
attach the View to the Frame?
AVee
2007-06-21 15:06:02 UTC
Permalink
Thank you, Mark. That did it!
Post by Mark Salsbery
Try calling CFrameWnd::InitialUpdateFrame() after creating/loading the frame
window.
Mark
Post by AVee
How does the CFrameWnd->m_pActiveView member function get attached? I am
creating a CFrameWnd object with CRuntimeClass->CreateObject(), and passing
it a my RUNTIME_CLASS( myViewClass) View class in the
CCreateContext->m_pNewViewClass member when I pass the CreateContext argument
to LoadFrame(). Everything works fine when run ActivateFrame(), View and
Frame functioning normally. However, when I call CFrameWnd->GetActiveView(),
which only returns its member m_pActiveView, it returns NULL. Tracing
through MFC source, I noticed that when the View object is created, it
doesn't get saved to CFrameWnd->m_pActiveView. So, my question - How might I
attach the View to the Frame?
Loading...