15,979
社区成员
发帖
与我相关
我的任务
分享
CRuntimeClass* pViewClass = RUNTIME_CLASS(CMainView);
CCreateContext Context;
Context.m_pCurrentDoc = NULL;
Context.m_pCurrentFrame = NULL;
Context.m_pLastView = NULL;
Context.m_pNewDocTemplate = NULL;
Context.m_pNewViewClass = pViewClass;
CWnd *pWnd = NULL;
pWnd = DYNAMIC_DOWNCAST(CWnd,pViewClass->CreateObject());
pWnd->Create(NULL,NULL,WS_VISIBLE,CRect(0,0,0,0),GetParent(),0,&Context);
g_pMainView = DYNAMIC_DOWNCAST(CMainView,pWnd);