CView *pOldActiveView=GetActiveView();
CView *pNewActiveView=(CView *)GetDlgItem(nForm);
if(pNewActiveView==NULL)
{
switch(nForm)//nForm是对话框ID;
{
case IDD_MULTISCREEN_FORM1:
pNewActiveView=(CView *)new CView1;
break;
case IDD_MULTISCREEN_FORM2:
pNewActiveView=(CView *)new CView2;
break;
case IDD_MULTISCREEN_FORM3:
pNewActiveView=(CView *)new CView3;
break; }
CCreateContext context; //将文档和视图相连
context.m_pCurrentDoc=pOldActiveView->GetDocument();
pNewActiveView-〉Create(NULL,NULL,WS_CHILD,
CFrameWnd::rectDefault,this,nForm,&context);
pNewActiveView->OnInitialUpdate();
编译错误:pNewActiveView->OnInitialUpdate();
Variaries窗口:
- &context 0x0012fa14
- m_pNewViewClass 0x00000000 {???}
m_lpszClassName CXX0030: Error: expression cannot be evaluated
m_nObjectSize CXX0030: Error: expression cannot be evaluated
m_wSchema CXX0030: Error: expression cannot be evaluated
m_pfnCreateObject CXX0030: Error: expression cannot be evaluated
m_pfnGetBaseClass CXX0030: Error: expression cannot be evaluated
m_pNextClass CXX0030: Error: expression cannot be evaluated
+ m_pCurrentDoc 0x00421540 {CMultiScreenDoc}
- m_pNewDocTemplate 0x00000000 {CDocTemplate}
CCmdTarget CXX0030: Error: expression cannot be evaluated
m_bAutoDelete CXX0030: Error: expression cannot be evaluated
m_pAttachedFactory CXX0030: Error: expression cannot be evaluated
m_hMenuInPlace CXX0017: Error: symbol "" not found
m_hAccelInPlace CXX0017: Error: symbol "" not found
m_hMenuEmbedding CXX0030: Error: expression cannot be evaluated
m_hAccelEmbedding CXX0030: Error: expression cannot be evaluated
m_hMenuInPlaceServer CXX0030: Error: expression cannot be evaluated
m_hAccelInPlaceServer CXX0030: Error: expression cannot be evaluated
m_nIDResource CXX0030: Error: expression cannot be evaluated
m_nIDServerResource CXX0030: Error: expression cannot be evaluated
m_nIDEmbeddingResource CXX0030: Error: expression cannot be evaluated
m_nIDContainerResource CXX0030: Error: expression cannot be evaluated
m_pDocClass CXX0030: Error: expression cannot be evaluated
m_pFrameClass CXX0030: Error: expression cannot be evaluated
m_pViewClass CXX0030: Error: expression cannot be evaluated
m_pOleFrameClass CXX0030: Error: expression cannot be evaluated
m_pOleViewClass CXX0030: Error: expression cannot be evaluated
+ m_strDocStrings {???}
+ m_pLastView 0x00000000 {CView hWnd=???}
+ m_pCurrentFrame 0x00000000 {CFrameWnd hWnd=???}
nForm 131
- pNewActiveView 0x00422230 {CView hWnd=0xdddddddd}
+ CWnd {CWnd hWnd=0xdddddddd}
+ m_pDocument 0xdddddddd {CDocument}
- this 0x00421330 {CMainFrame hWnd=0x0007037a}
+ CFrameWnd {CFrameWnd hWnd=0x0007037a}
+ classCMainFrame {"CMainFrame"}
m_bFirst 0
+ m_wndStatusBar {CStatusBar hWnd=0x0002043e}
+ m_wndToolBar {CToolBar hWnd=0x00060378}
+ _messageEntries 0x00417040 struct AFX_MSGMAP_ENTRY const * const CMainFrame::_messageEntries
- messageMap {...}
pfnGetBaseMap 0x004010eb CMainFrame::_GetBaseMessageMap(void)
+ lpEntries 0x00417040 struct AFX_MSGMAP_ENTRY const * const CMainFrame::_messageEntries
CView *pNewActiveView=(CView *)GetDlgItem(nForm);
if(pNewActiveView==NULL)
{
switch(nForm)//nForm是对话框ID;
{
case IDD_MULTISCREEN_FORM1:
pNewActiveView=(CView *)new CView1;
break;
case IDD_MULTISCREEN_FORM2:
pNewActiveView=(CView *)new CView2;
break;
case IDD_MULTISCREEN_FORM3:
pNewActiveView=(CView *)new CView3;
break; }
CCreateContext context; //将文档和视图相连
context.m_pCurrentDoc=pOldActiveView->GetDocument();
pNewActiveView-〉Create(NULL,NULL,WS_CHILD,
CFrameWnd::rectDefault,this,nForm,&context);
pNewActiveView->OnInitialUpdate();
编译错误:pNewActiveView->OnInitialUpdate();
Variaries窗口:
- &context 0x0012fa14
- m_pNewViewClass 0x00000000 {???}
m_lpszClassName CXX0030: Error: expression cannot be evaluated
m_nObjectSize CXX0030: Error: expression cannot be evaluated
m_wSchema CXX0030: Error: expression cannot be evaluated
m_pfnCreateObject CXX0030: Error: expression cannot be evaluated
m_pfnGetBaseClass CXX0030: Error: expression cannot be evaluated
m_pNextClass CXX0030: Error: expression cannot be evaluated
+ m_pCurrentDoc 0x00421540 {CMultiScreenDoc}
- m_pNewDocTemplate 0x00000000 {CDocTemplate}
CCmdTarget CXX0030: Error: expression cannot be evaluated
m_bAutoDelete CXX0030: Error: expression cannot be evaluated
m_pAttachedFactory CXX0030: Error: expression cannot be evaluated
m_hMenuInPlace CXX0017: Error: symbol "" not found
m_hAccelInPlace CXX0017: Error: symbol "" not found
m_hMenuEmbedding CXX0030: Error: expression cannot be evaluated
m_hAccelEmbedding CXX0030: Error: expression cannot be evaluated
m_hMenuInPlaceServer CXX0030: Error: expression cannot be evaluated
m_hAccelInPlaceServer CXX0030: Error: expression cannot be evaluated
m_nIDResource CXX0030: Error: expression cannot be evaluated
m_nIDServerResource CXX0030: Error: expression cannot be evaluated
m_nIDEmbeddingResource CXX0030: Error: expression cannot be evaluated
m_nIDContainerResource CXX0030: Error: expression cannot be evaluated
m_pDocClass CXX0030: Error: expression cannot be evaluated
m_pFrameClass CXX0030: Error: expression cannot be evaluated
m_pViewClass CXX0030: Error: expression cannot be evaluated
m_pOleFrameClass CXX0030: Error: expression cannot be evaluated
m_pOleViewClass CXX0030: Error: expression cannot be evaluated
+ m_strDocStrings {???}
+ m_pLastView 0x00000000 {CView hWnd=???}
+ m_pCurrentFrame 0x00000000 {CFrameWnd hWnd=???}
nForm 131
- pNewActiveView 0x00422230 {CView hWnd=0xdddddddd}
+ CWnd {CWnd hWnd=0xdddddddd}
+ m_pDocument 0xdddddddd {CDocument}
- this 0x00421330 {CMainFrame hWnd=0x0007037a}
+ CFrameWnd {CFrameWnd hWnd=0x0007037a}
+ classCMainFrame {"CMainFrame"}
m_bFirst 0
+ m_wndStatusBar {CStatusBar hWnd=0x0002043e}
+ m_wndToolBar {CToolBar hWnd=0x00060378}
+ _messageEntries 0x00417040 struct AFX_MSGMAP_ENTRY const * const CMainFrame::_messageEntries
- messageMap {...}
pfnGetBaseMap 0x004010eb CMainFrame::_GetBaseMessageMap(void)
+ lpEntries 0x00417040 struct AFX_MSGMAP_ENTRY const * const CMainFrame::_messageEntries
解决方案 »
- 求助!DialogBox的显示问题
- 读Excel的速度好慢
- 通过文件头判断文件编码问题 vc
- 用MFC时,程序自动生成的这些预编译指令是干什么用的
- 问一个关于书籍的问题....
- ListControl??????????????????
- IShellLink如何使用?
- ”Run-Time Check Failure #2 - Stack around the variable 'chTemp' was corrupted.“是什么错误?
- 如何把做完的.ocx或.dll打包成.cab放在网页中给别人下载?
- 怎么样才能实现对音量的控制,最好能达到有下脚喇叭的功能
- ^_^请问^_^如何读@_@记事本@_@里的内容啊?
- 急救!有关在视图中建立编辑框的问题!不支持CTRL+C和CTRL+V
So I can help you.
[email protected]
http://rosement.diy.163.com
压成ZIP文件~!放个空间上~~~~~给人下啊!
void CMainFrame::SwitchForm(int nFormID)
{
CView* pOldView=GetActiveView();
CView* pNewView=(CFormView*)GetDlgItem(nFormID);
if(pNewView==NULL)
{
switch(nFormID)
{
case IDD_FILE_TRANSFER:
pNewView=(CView*)new CFile_Transfer;
break;
case IDD_ILLPC_FORM:
pNewView=(CView*)new CIllpcView;
break;
case IDD_SCANCER:
pNewView=(CView*)new CSCAN;
break;
default:
break;
}
CCreateContext context;
context.m_pCurrentDoc=pOldView->GetDocument();
pNewView->Create(NULL,NULL,0L,CFrameWnd::rectDefault,
this,nFormID,&context);
pNewView->OnInitialUpdate();
}
SetActiveView(pNewView);
pNewView->ShowWindow(SW_SHOW);
pOldView->ShowWindow(SW_HIDE);
if(pOldView->GetRuntimeClass()==RUNTIME_CLASS(CFile_Transfer))
{
pOldView->SetDlgCtrlID(IDD_FILE_TRANSFER);
}
else if(pOldView->GetRuntimeClass()==RUNTIME_CLASS(CIllpcView))
{
pOldView->SetDlgCtrlID(IDD_ILLPC_FORM);
}
else
{
pOldView->SetDlgCtrlID(IDD_SCANCER);
}
pNewView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
RecalcLayout();
}