我自己写了一个简单的类CLine;
但是当我在CHelloDoc中,写一个函数: CLine *hello();
头文件也已经包含了,但是一编译,就报错syntax error : missing ';' before '*'
但是不知道为什么。
// HelloDoc.cpp : implementation of the CHelloDoc class
//#include "stdafx.h"
#include "Hello.h"
#include "HelloDoc.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
class CHelloDoc : public CDocument
{
protected: // create from serialization only
CHelloDoc();
DECLARE_DYNCREATE(CHelloDoc)// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHelloDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL// Implementation
public:
CLine * hello();//////此处出错 syntax error :missing ';before '*'
virtual ~CHelloDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endifprotected:// Generated message map functions
protected:
//{{AFX_MSG(CHelloDoc)
// 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()
};
但是当我在CHelloDoc中,写一个函数: CLine *hello();
头文件也已经包含了,但是一编译,就报错syntax error : missing ';' before '*'
但是不知道为什么。
// HelloDoc.cpp : implementation of the CHelloDoc class
//#include "stdafx.h"
#include "Hello.h"
#include "HelloDoc.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
class CHelloDoc : public CDocument
{
protected: // create from serialization only
CHelloDoc();
DECLARE_DYNCREATE(CHelloDoc)// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHelloDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL// Implementation
public:
CLine * hello();//////此处出错 syntax error :missing ';before '*'
virtual ~CHelloDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endifprotected:// Generated message map functions
protected:
//{{AFX_MSG(CHelloDoc)
// 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()
};
解决方案 »
- IOCP完成端口可以随时发数据吗?
- vc有没有函数让图片自动缩放和拉伸的呢?
- media player 控件中的播放列表如何实现
- 忽然发现CSDN回帖增加了BLOG链接,很是欣喜,散分小庆一下
- 如何把一个数字位图用ImageList来显示出来?有一个位图:0123456789,然后怎么显示每一个数字,是用ImageList吗?
- 关于CRecordset::IsFieldNull
- 100分求助:关于MFC的消息映射问题,高手请进,非高手请帮忙UP,来者有分哈
- 如何让listctrol控件大小随着所属的窗口变化而变化
- 还是关于Windows WDM 设备驱动程序的
- *一*个*奇*怪*的*问*题*。
- 高分求救,如何用VC 写一个打印预览的activeX.
- 在线等待
前加上 class CLine;
#include "Helloview.h"