Directly creating a CFormView as a child?
-
How could we have an object (not dynamicall created) of CFormView (and derivatives)? I've tried: CSomeView someview; someview.Create(...); but they give me "An unsupported operation was attempted". Any way for me to create CSomeView manually (explicit call to Create() ) ? Or any suggestion/hack on allowing me to do this?
-
How could we have an object (not dynamicall created) of CFormView (and derivatives)? I've tried: CSomeView someview; someview.Create(...); but they give me "An unsupported operation was attempted". Any way for me to create CSomeView manually (explicit call to Create() ) ? Or any suggestion/hack on allowing me to do this?
-
How could we have an object (not dynamicall created) of CFormView (and derivatives)? I've tried: CSomeView someview; someview.Create(...); but they give me "An unsupported operation was attempted". Any way for me to create CSomeView manually (explicit call to Create() ) ? Or any suggestion/hack on allowing me to do this?
-
To be exact, I want it to be a child (control?) in a (well-known)CSizableControlBar derivative.
It should not be a problem to create a CFormView can be seen from this example http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0998/c++0998.htm&nav=/msj/0998/newnav.htm
-
It should not be a problem to create a CFormView can be seen from this example http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0998/c++0998.htm&nav=/msj/0998/newnav.htm
hmm... the example doesn't show me how to create a CFormView DIRECTLY... nice article though. thanx :) What I want is, the CFormView is not created dynamically under a CSplitterWnd, but I want it to be under a CControlBar... and created (maybe) in OnCreate() of CControlBar by calling CFormView::Create().
-
hmm... the example doesn't show me how to create a CFormView DIRECTLY... nice article though. thanx :) What I want is, the CFormView is not created dynamically under a CSplitterWnd, but I want it to be under a CControlBar... and created (maybe) in OnCreate() of CControlBar by calling CFormView::Create().
I don't know if this of any help but I use this for create CFormView's on the fly.
#define VIEWS_RECALLING_VIEW AFX_IDW_PANE_FIRST + 5 m_pRecallingView = new CRecallingView; AddView(m_pRecallingView, VIEWS_RECALLING_VIEW); } void CCTIReceptionApp::AddView(CView* pView, UINT nID) { CDocument* pCurrentDoc = ((CFrameWnd*) m_pMainWnd)->GetActiveDocument(); CCreateContext newContext; newContext.m_pNewViewClass = NULL; newContext.m_pNewDocTemplate = NULL; newContext.m_pLastView = NULL; newContext.m_pCurrentFrame = NULL; newContext.m_pCurrentDoc = pCurrentDoc; CRect rect(0,0,0,0); char szTemp[64]; sprintf(szTemp, "ViewList%x", nID); pView->Create(NULL, NULL, (AFX_WS_DEFAULT_VIEW & ~WS_VISIBLE), // views are created with the style of AFX_WS_DEFAULT_VIEW // In MFC 4.0, this is (WS_BORDER | WS_VISIBLE | WS_CHILD) rect, m_pMainWnd, nID, &newContext); pView->SendMessage(WM_INITIALUPDATE, 0, 0); }
Michael :-) Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor