关于VC6的一个很弱的问题
chrch 2004-02-14 12:24:53 各位高手,我最近在学习使用MSVC6,照着书上编了一个很简单的单文档应用程序,但出了一些错误,还请各位高手指点迷津呀!
这是那个报错的头文件:
// Day10Doc.h : interface of the CDay10Doc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DAY10DOC_H__19CF0345_7E60_4B91_9F57_38773206B771__INCLUDED_)
#define AFX_DAY10DOC_H__19CF0345_7E60_4B91_9F57_38773206B771__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CDay10Doc : public CDocument
{
protected: // create from serialization only
CDay10Doc();
DECLARE_DYNCREATE(CDay10Doc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDay10Doc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
CLine* GetLine(int nIndex);
int GetLineCount();
CLine* AddLine(CPoint ptFrom, CPoint ptTo);
virtual ~CDay10Doc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDay10Doc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CObArray m_oaLines;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DAY10DOC_H__19CF0345_7E60_4B91_9F57_38773206B771__INCLUDED_)
编译后的出错信息:
--------------------Configuration: Day10 - Win32 Debug--------------------
Compiling...
Day10.cpp
d:\microsoft visual studio\myprojects\day10\day10doc.h(35) : error C2143: syntax error : missing ';' before '*'
d:\microsoft visual studio\myprojects\day10\day10doc.h(35) : error C2501: 'CLine' : missing storage-class or type specifiers
d:\microsoft visual studio\myprojects\day10\day10doc.h(35) : error C2501: 'GetLine' : missing storage-class or type specifiers
d:\microsoft visual studio\myprojects\day10\day10doc.h(37) : error C2143: syntax error : missing ';' before '*'
d:\microsoft visual studio\myprojects\day10\day10doc.h(37) : error C2501: 'CLine' : missing storage-class or type specifiers
d:\microsoft visual studio\myprojects\day10\day10doc.h(37) : error C2501: 'AddLine' : missing storage-class or type specifiers
Error executing cl.exe.
Creating browse info file...
Day10.exe - 6 error(s), 0 warning(s)