Undocumented Call
Linda Kasparek -- lindak@pumpkin.iii.net Tuesday, January 30, 1996 This is the only way I found to create a CView-derived child window inside another CView-derived window which is part of a document/view SDI app. But, I believe CreateObject is undocumented. Is that so? (I'd like to avoid having to do that). If I can't create my CView-derived child window in this manner, what other ways are there? Here's the code: void cTCView::OnInitialUpdate() { cBaseView::OnInitialUpdate(); CCreateContext context; context.m_pNewViewClass = RUNTIME_CLASS(cTCView); context.m_pCurrentDoc = GetDocument(); if (context.m_pCurrentDoc != NULL) context.m_pNewDocTemplate = context.m_pCurrentDoc->GetDocTemplate(); else context.m_pNewDocTemplate = NULL; context.m_pLastView = this; context.m_pCurrentFrame = NULL; CWnd* pWnd; pWnd = (CWnd*)RUNTIME_CLASS(cTabContent)->CreateObject(); ASSERT_KINDOF(CWnd, pWnd); ASSERT(pWnd->m_hWnd == NULL); DWORD dwStyle = AFX_WS_DEFAULT_VIEW; pWnd->Create(NULL, NULL, dwStyle, CRect(0, 28, 800, 800), this, 1, &context); } TIA, Linda
Mike Blaszczak -- mikeblas@interserv.com Wednesday, January 31, 1996 On Tue, 30 Jan 1996, lindak@pumpkin.iii.net (Linda Kasparek) wrote: >This is the only way I found to create a CView-derived child window inside >another CView-derived >window which is part of a document/view SDI app. But, I believe >CreateObject is undocumented. >Is that so? (I'd like to avoid having to do that). If I can't create my >CView-derived child >window in this manner, what other ways are there? It isn't poorly documented, it's just poorly indexed. You can find documentation of it on the topic that documents CRuntimeClass. .B ekiM -- TCHAR szZZTop[] = _T("I'm just a-scared to admit it");
| Вернуться в корень Архива |