我现在要在对话框里的一个button单击时间里去new并且显示一个CView窗口。 必须是CView窗口。由于CView的构造函数是protected的,所以不能直接create.我用CView* pView = (CView *)(RUNTIME_CLASS(CView)->CreateObject());pView->ShowWindow(SW_SHOW);还是不行求高人帮满 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 重载cview 自己写个public的 create 调用 cview的那个protect的create void CExDlg::OnButton1() { CCreateContext pContext; if(pMainFrm==NULL) { pMainFrm = new CMainFrame; pContext.m_pCurrentDoc = NULL; pContext.m_pCurrentFrame = pMainFrm; pContext.m_pNewViewClass = RUNTIME_CLASS(CYourView); pContext.m_pNewDocTemplate = NULL; if(pMainFrm->Create(NULL, _T("MyView"), WS_OVERLAPPEDWINDOW, CFrameWnd::rectDefault, NULL, NULL, 0, &pContext)) { pMainFrm->ShowWindow(TRUE); } }} CCreateContext pContext;if(pMainFrm==NULL){pMainFrm = new CMainFrame;pContext.m_pCurrentDoc = NULL;pContext.m_pCurrentFrame = pMainFrm;pContext.m_pNewViewClass = RUNTIME_CLASS(CYourView);pContext.m_pNewDocTemplate = NULL;if(pMainFrm->Create(NULL, _T("MyView"), WS_OVERLAPPEDWINDOW, CFrameWnd::rectDefault,NULL, NULL, 0, &pContext)){pMainFrm->ShowWindow(TRUE);} 如何只更新组合框。。。 数据库链接出错 unresolved external symbol MFC写的Wince应用程序报如下错误如何解决 关于保存网页源代码的问题。为什么最大只能保存4096字节??? 哪位有FTP连接建立过程成功的源码示例?能否共享一下?谢谢! htmlview/htmdialog怎么屏蔽那个该死的查看原代码的菜单? 一个奇怪的问题 请问在那里可以找到哈希和数字签名的代码? 动态申请2维数组。释放的时候出错。请高人指点!! 12年毕业,做了两年的C++开发,薪水9000 怎么样 在线等~~新手~~ado添加删除记录的问题 打印预览页面问题,附代码
{
CCreateContext pContext;
if(pMainFrm==NULL)
{
pMainFrm = new CMainFrame;
pContext.m_pCurrentDoc = NULL;
pContext.m_pCurrentFrame = pMainFrm;
pContext.m_pNewViewClass = RUNTIME_CLASS(CYourView);
pContext.m_pNewDocTemplate = NULL; if(pMainFrm->Create(NULL, _T("MyView"), WS_OVERLAPPEDWINDOW, CFrameWnd::rectDefault,
NULL, NULL, 0, &pContext))
{
pMainFrm->ShowWindow(TRUE);
}
}
}
if(pMainFrm==NULL)
{
pMainFrm = new CMainFrame;
pContext.m_pCurrentDoc = NULL;
pContext.m_pCurrentFrame = pMainFrm;
pContext.m_pNewViewClass = RUNTIME_CLASS(CYourView);
pContext.m_pNewDocTemplate = NULL;if(pMainFrm->Create(NULL, _T("MyView"), WS_OVERLAPPEDWINDOW, CFrameWnd::rectDefault,
NULL, NULL, 0, &pContext))
{
pMainFrm->ShowWindow(TRUE);
}