...我的切分界面问题中想在右边的子窗口中再进行切分,编写的程序在调试是右20个错误,2个警告,现在让我改的只剩4个错误和2个警告了,各位大侠帮帮忙,我不圣感激。报错如下:
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\dbvView.cpp(96) : error C2259: ’CNewView’ : cannot instantiate abstract class due to following members:
d:\vc\msdev98\myprojects\dbvview\mainfrm.h(68) : see declaration of ’CNewView’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(96) : 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(96) : error C2259: ’CNewView’ : cannot instantiate abstract class due to following members:
d:\vc\msdev98\myprojects\dbvview\mainfrm.h(68) : see declaration of ’CNewView’
D:\VC\MSDev98\MyProjects\dbvView\dbvView.cpp(96) : 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(120) : error C2065: ’WM_INITIALUPDATE’ : undeclared identifier
dbvViewDoc.cpp
dbvViewView.cpp
Graphics.cpp
LeftView.cpp
MainFrm.cpp
D:\VC\MSDev98\MyProjects\dbvView\MainFrm.cpp(307) : error C2065: ’GWW_ID’ : undeclared identifier
Generating Code...
Error executing cl.exe.
Creating browse info file...
dbvView.exe - 4 error(s), 2 warning(s)
其中dbvView.cpp的程序如下:
// dbvView.cpp : Defines the class behaviors for the application.
//
#include <iostream>
using namespace std;
#include "stdafx.h"
#include "dbvView.h"
#include "dbvViewView.h"
#include "MainFrm.h"
#include "dbvViewDoc.h"
#include "LeftView.h"
//#include "Graphics.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDbvViewApp
BEGIN_MESSAGE_MAP(CDbvViewApp, CWinApp)
//{{AFX_MSG_MAP(CDbvViewApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDbvViewApp construction
CDbvViewApp::CDbvViewApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CDbvViewApp object
CDbvViewApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDbvViewApp initialization
BOOL CDbvViewApp::InitInstance()
{
AfxEnableControlContainer();
// 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.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CDbvViewDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CLeftView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
CView* pActiveView = ((CFrameWnd*)m_pMainWnd)->GetActiveView();
m_pOldView = pActiveView;
m_pNewView = (CView*) new CNewView;
CDocument* pCurrentDoc = ((CFrameWnd*)m_pMainWnd)->GetActiveDocument();
// 初始化一个CCreateContext对象来指向这个活动文档
// 利用这个环境(context),新视图在CView::OnCreate()中该视图被创建时。被加入到该文档。
CCreateContext newContext;
newContext.m_pNewViewClass = NULL;
newContext.m_pNewDocTemplate = NULL;
newContext.m_pLastView = NULL;
newContext.m_pCurrentFrame = NULL;
newContext.m_pCurrentDoc = pCurrentDoc;
// 最初的活动视图的ID是AFX_IDW_PANE_FIRST,
// 对它加一使新增的视图工作在标准的文档/视图环境下
// 注意这一技巧不能用于切割视图图类CSplitterWnd的情况
UINT viewID = AFX_IDW_PANE_FIRST + 1;
CRect rect(0,0,0,0); // 将在后面重新设置大小
// 创建一个新视图,本例中该视图的生命周期与应用程序相同
// 应用程序关闭时会自动地清除视图对象
m_pNewView->Create(NULL, "AnyWindowName", WS_CHILD, rect, m_pMainWnd, viewID, &newContext);
// 当一个文档模板创建一个视图,消息WM_INITIALUPDATE会被自动地发出,
// 但是本代码必须明确地发出这个消息(这个消息的作用就是让视图对象调用自己的OnInitialUpdate函数进行初始化)
m_pNewView->SendMessage(WM_INITIALUPDATE, 0, 0);
// 加入的新代码到这里结束
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;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CDbvViewApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CDbvViewApp message handlers
还有mainfrm.h(的程序如下:
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__F96F5C25_1215_4A2E_96CE_7A0378AE816F__INCLUDED_)
#define AFX_MAINFRM_H__F96F5C25_1215_4A2E_96CE_7A0378AE816F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CDbvViewView;
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
protected:
CSplitterWnd m_wndSplitter;
CSplitterWnd m_wndSplitter1;
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
CDbvViewView* GetRightPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
/* virtual HRESULT _stdcall QueryInterface(const IID & iid, void ** ppv);
virtual ULONG _stdcall AddRef();
virtual ULONG _stdcall Release(); */
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// 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 OnUpdateViewStyles(CCmdUI* pCmdUI);
afx_msg void OnViewStyle(UINT nCommandID);
DECLARE_MESSAGE_MAP()
};
// Overrides
class CNewView : virtual public CView
{
CView* SwitchView();
};
CView* m_pOldView;
CView* m_pNewView;
//CView* SwitchView();
CView* pActiveView;
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__F96F5C25_1215_4A2E_96CE_7A0378AE816F__INCLUDED_)
大侠们帮帮忙,我急等着用,谢谢了。