Type: Posts; User: sunnysky
Search took 0.01 seconds.
April 16th, 2014, 02:35 PM
I also figured out how m_pDocument in each view is set.
When creating views in CMainFrame::OnCreateClient(), CView::OnCreate() is called for each view to be created. In CView::OnCreate(), the...
April 16th, 2014, 12:45 PM
April 16th, 2014, 11:05 AM
I finally figured out what the problem is.
The problem is the CTabView as Victor pointed out in post #9.
My CSecondView class inherits CTabView. So I need to override OnInitialUpdate() like:
April 11th, 2014, 03:25 PM
That's what I want to find out. Why does it exist this time?
Besides, how does m_pDocument get set in the two views that the wizard creates? I debugged in to the CSingleDocTemplate constructor...
April 11th, 2014, 01:11 PM
When a "Windows Explorer" application is created, the SetActiveView() function is successfully called in CFrameWnd::InitialUpdateFrame(). While I create splitter windows, SetActiveView() in...
April 10th, 2014, 07:14 PM
So I was right in post 27, wasn't I?
April 10th, 2014, 03:04 PM
Then I created a "Windows Explorer" style application. The wizard created OnCreateClient() in CMainFrame. But CFrameWnd::OnCreateClient() is not called this time. However,...
April 10th, 2014, 02:37 PM
I used "MFC Standard" to create a brand new project. I didn't add any splitter views. Then I override OnCreateClient() in CMainFrame like this.
April 9th, 2014, 01:52 PM
I got this book. But it may not cover point 2 in your post 20.
April 9th, 2014, 01:51 PM
I think since I override OnCreateClient() in CMainFrame, I need to explicitly call CFrameWnd::OnCreateClient(lpcs, pContext) at the beginning of CMainFrame::OnCreateClient().
April 9th, 2014, 10:15 AM
"CWnd* pWnd = GetDescendantWindow(AFX_IDW_PANE_FIRST, TRUE);" in CFrameWnd::InitialUpdateFrame() returns NULL in the project built from "MFC Standard" style even though "bMakeVisible" is TRUE.
April 9th, 2014, 09:01 AM
I am learning MFC while getting familiar with our existing project. Unfortunately our existing project is using this ad-hoc approach.
Do you know any book teaching the approaches you mentioned?
April 9th, 2014, 08:57 AM
I found CFrameWnd::InitialUpdateFrame is called indirectly from "if (!ProcessShellCommand(cmdInfo))" statement in the CAlohaApp::InitInstance() function. But it wasn't called in an application built...
April 8th, 2014, 02:22 PM
The generated "Windows Explorer" style code doesn't do SetActiveView() in CMainFrame::OnCreateClient() after creating the split views. Strange.
April 8th, 2014, 02:04 PM
Got it. I was just expecting some more standard learning approach.
April 8th, 2014, 02:03 PM
That happens when I do things from scratch. I got NULL CDocument pointer when using GetActiveDocument(). This is shown in the attached program in the same projects.
April 8th, 2014, 01:03 PM
But that will sacrifice flexibility. The Wizard only provide CListView and CTreeView.
April 8th, 2014, 12:27 PM
For instance, the examples I saw don't call "CFrameWnd::OnCreateClient(lpcs, pContext)" in "CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )", but I found that if I don't...
April 8th, 2014, 12:24 PM
I created these view classes with the help of wizard and didn't add any code. My problem is that other than application specific members, I don't know which methods should be...
April 8th, 2014, 10:59 AM
Here it is.
April 8th, 2014, 09:33 AM
Thanks Victor. But I think it is not enough. I added "SetActiveView((CView*)m_wndSplitter.GetPane(0, 0));" before "return TRUE;" and it still doesn't work.
I stepped into...
April 8th, 2014, 08:33 AM
It's a message handler.
April 7th, 2014, 03:35 PM
I created two split views like this:
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )
April 2nd, 2014, 09:10 AM
Thanks. These information are very helpful.
April 1st, 2014, 09:34 AM
I am working on an existing project and noticed some interesting phenomenon. I then created a small project and reproduced this behavior.
When I created a new project, the system...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.