现存的CView对象已经和Doc对象关联上,要求生成CFormView对象的代码在CView的操作代码里面。最好给出例子代码,要不给点关键位置的代码也行,谢谢了··
解决方案 »
- XImage类如何使用?
- 如果在用户区覆盖一个对话框工具栏(其他可以当容器的也可以)
- 有没有国际标谁的语言列表?
- 菜鸟问题Windows应用程序的执行过程是怎么样的过程
- 在视图中画标尺,怎么处理这样的刻度调整?
- CListCtrl(REPORT TYPE)控件中,每列的列头是什么控件,怎样改变该列列头中的文字颜色?--正确就结帖
- 如何在service中使用hook呢?
- 为什么基于对话框应用程序的标题栏不相应WM_NCLBUTTONUP消息?
- 怎样改变CEditView的缺省字体
- 在基于对话框的程序中对数据库(例如access)进行操作(查找,删除)不用dbgrid等相关控件,如何做?
- 都有哪些用vc写的开源项目?
- 用CDaoDatabase不能访问acess2000,可以访问acess97,不知道为什么?有没有其他的办法不用odbc直接访问mdb
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif // Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views. pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CClientTestDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CClientTestView));
AddDocTemplate(pDocTemplate);
pMyListDocTemplate=new CSingleDocTemplate(IDR_LISTFRAME,RUNTIME_CLASS(CSockClientTestDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CMyTextListView));
AddDocTemplate(pMyListDocTemplate);
//pMyListDocTemplate=new CSingleDocTemplate(
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE; // The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow(); return TRUE;
}
谁来教教我怎么在CView上画一个CFormView啊!急啊~
//切换
CView * CMyView::SwitchView(int vViewId)
{
CView *pSwitchView;
CRightFrame *m_pRightFrame= DYNAMIC_DOWNCAST(CRightFrame, m_wndSplitter.GetPane(0, 1));
if(!m_pRightFrame)
return NULL;
pSwitchView=m_pRightFrame->SwitchView(vViewId);
return pSwitchView;}
//SwitchView实现
CView * CRightFrame::SwitchView(int vnViewId)
{ CView* pOldActiveView = GetActiveView();
CView* pNewActiveView = NULL; switch (vnViewId)
{
case VIEW_OUTLOOKDESC:
pNewActiveView = (CView*) m_pDescView;
break; case VIEW_OUTLOOKLIST:
pNewActiveView = (CView*) m_pListView;
break;
case VIEW_DAYPLAN:
pNewActiveView = (CView *)m_pDayPlanView;
break;
case VIEW_LEFT:
pNewActiveView = (CView*) m_pLeftView;
break;
case VIEW_HTML:
pNewActiveView = (CView*) m_pHtmlView;
break; }
if (pNewActiveView)
{
// don't switch when views are the same
if (pOldActiveView == pNewActiveView) return pNewActiveView; SetActiveView(pNewActiveView);
pNewActiveView->ShowWindow(SW_SHOW);
pNewActiveView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
pOldActiveView->ShowWindow(SW_HIDE);
pOldActiveView->SetDlgCtrlID(m_nCurrentViewID);
m_nCurrentViewID = vnViewId; RecalcLayout();
}
return pNewActiveView;
}