编译通不过
在CMainFrame类中
protected:
CSplitterWnd m_wndSplitter;
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
BOOL bResult = m_wndSplitter1.CreateStatic(this,1,2); bResult |= m_wndSplitter1.CreateView(0,0,
RUNTIME_CLASS(CFirstView),CSize(100,0),pContext);
bResult = m_wndSplitter2.CreateStatic(&m_wndSplitter1,
2,1,WS_CHILD | WS_VISIBLE,
m_wndSplitter1.IdFromRowCol(0,1));
bResult |= m_wndSplitter1.CreateView(0,0,
RUNTIME_CLASS(CSecondView),CSize(0,50),pContext);
bResult |= m_wndSplitter2.CreateView(1,0,
RUNTIME_CLASS(CThirdView),CSize(0,0),pContext);
return(bResult);}为何编译时报
error C2653: 'CFirstView' : is not a class or namespace name
error C2065: 'classCFirstView' : undeclared identifier
error C2653: 'CSecondView' : is not a class or namespace name
error C2065: 'classCSecondView' : undeclared identifier
error C2653: 'CThirdView' : is not a class or namespace name
error C2065: 'classCThirdView' : undeclared identifier
在CMainFrame类中
protected:
CSplitterWnd m_wndSplitter;
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
BOOL bResult = m_wndSplitter1.CreateStatic(this,1,2); bResult |= m_wndSplitter1.CreateView(0,0,
RUNTIME_CLASS(CFirstView),CSize(100,0),pContext);
bResult = m_wndSplitter2.CreateStatic(&m_wndSplitter1,
2,1,WS_CHILD | WS_VISIBLE,
m_wndSplitter1.IdFromRowCol(0,1));
bResult |= m_wndSplitter1.CreateView(0,0,
RUNTIME_CLASS(CSecondView),CSize(0,50),pContext);
bResult |= m_wndSplitter2.CreateView(1,0,
RUNTIME_CLASS(CThirdView),CSize(0,0),pContext);
return(bResult);}为何编译时报
error C2653: 'CFirstView' : is not a class or namespace name
error C2065: 'classCFirstView' : undeclared identifier
error C2653: 'CSecondView' : is not a class or namespace name
error C2065: 'classCSecondView' : undeclared identifier
error C2653: 'CThirdView' : is not a class or namespace name
error C2065: 'classCThirdView' : undeclared identifier
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货