...各位大侠,我是VC新手,想编一个切分界面的程序,现在在程序中添加了视图类,想在以切分的界面中的右窗口再进行2行1列的切分,却出现了下列错误,请高手们帮帮忙,谢了。
Deleting intermediate files and output files for project ’dbvView - Win32 Debug’.
--------------------Configuration: dbvView - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
CGraphics.cpp
dbvView.cpp
d:\vc\msdev98\myprojects\dbvview\dbvviewview.h(20) : error C2143: syntax error : missing ’;’ before ’*’
d:\vc\msdev98\myprojects\dbvview\dbvviewview.h(20) : error C2501: ’CDbvViewDoc’ : missing storage-class or type specifiers
d:\vc\msdev98\myprojects\dbvview\dbvviewview.h(20) : error C2501: ’GetDocument’ : missing storage-class or type specifiers
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(91) : error C2065: ’PActiveView’ : undeclared identifier
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(91) : error C2440: ’=’ : cannot convert from ’int’ to ’class CView *’
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(92) : error C2259: ’CNewView’ : cannot instantiate abstract class due to following members:
d:\vc\msdev98\myprojects\dbvview\mainfrm.h(62) : see declaration of ’CNewView’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(92) : warning C4259: ’void __thiscall CView::OnDraw(class CDC *)’ : pure virtual function was not defined
d:\microsoft visual studio\vc98\mfc\include\afxwin.h(3594) : see declaration of ’OnDraw’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(92) : error C2259: ’CNewView’ : cannot instantiate abstract class due to following members:
d:\vc\msdev98\myprojects\dbvview\mainfrm.h(62) : see declaration of ’CNewView’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(92) : warning C4259: ’void __thiscall CView::OnDraw(class CDC *)’ : pure virtual function was not defined
d:\microsoft visual studio\vc98\mfc\include\afxwin.h(3594) : see declaration of ’OnDraw’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(102) : error C2039: ’m_CurrentDoc’ : is not a member of ’CCreateContext’
d:\microsoft visual studio\vc98\mfc\include\afxext.h(1070) : see declaration of ’CCreateContext’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(116) : error C2065: ’WM_INITIALUPDATE’ : undeclared identifier
dbvViewDoc.cpp
dbvViewView.cpp
Graphics.cpp
LeftView.cpp
MainFrm.cpp
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(136) : error C2653: ’CGraphics’ : is not a class or namespace name
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(136) : error C2065: ’classCGraphics’ : undeclared identifier
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(293) : error C2039: ’SwitchView’ : is not a member of ’CDbvViewApp’
d:\vc\msdev98\myprojects\dbvview\dbvview.h(22) : see declaration of ’CDbvViewApp’
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(295) : error C2065: ’m_pMainWnd’ : undeclared identifier
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(305) : error C2065: ’GWW_ID’ : undeclared identifier
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(313) : error C2065: ’pAcitiveView’ : undeclared identifier
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(313) : error C2227: left of ’->ShowWindow’ must point to class/struct/union
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(320) : error C2143: syntax error : missing ’;’ before ’*’
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(320) : error C2501: ’CWinapp’ : missing storage-class or type specifiers
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(320) : error C2501: ’papp’ : missing storage-class or type specifiers
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(320) : error C2440: ’initializing’ : cannot convert from ’class CWinApp *’ to ’int *’
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Generating Code...
Error executing cl.exe.
Creating browse info file...
dbvView.exe - 20 error(s), 2 warning(s)
第一、二、三个错误的源程序如下:
// dbvViewView.h : interface of the CDbvViewView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DBVVIEWVIEW_H__912078F3_E698_4A7D_A163_7A80176AD2FD__INCLUDED_)
#define AFX_DBVVIEWVIEW_H__912078F3_E698_4A7D_A163_7A80176AD2FD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CDbvViewView : public CListView
{
protected: // create from serialization only
CDbvViewView();
DECLARE_DYNCREATE(CDbvViewView);
// Attributes
public:
CDbvViewDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDbvViewView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CDbvViewView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDbvViewView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in dbvViewView.cpp
inline CDbvViewDoc* CDbvViewView::GetDocument()
{ return (CDbvViewDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DBVVIEWVIEW_H__912078F3_E698_4A7D_A163_7A80176AD2FD__INCLUDED_)