标题:求助?关于collection类的声明错误
只看楼主
wandd
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2005-5-12
 问题点数:0 回复次数:1 
求助?关于collection类的声明错误

class CStroke :public CObject
{
public:
CStroke(UINT nPenWidth);
protected:
CStroke();
DECLARE_SERIAL(CStroke);

// Attributes
protected:
UINT m_nPenWidth;
public:
CArray<CPoint,CPoint> m_pointArray;

//Operation
public:
BOOL DrawStroke(CDC* pDC);
public:
virtual void Serialize(CArchive& ar);
};
/////////////////////////////////////////////////////////////////////////////
错误信息
//////////////////////////////////////////////////////////////////////
--------------------Configuration: Scribble - Win32 Debug--------------------
Compiling...
Scribble.cpp
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2143: syntax error : missing ';' before '<'
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2501: 'CArray' : missing storage-class or type specifiers
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2059: syntax error : '<'
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2238: unexpected token(s) preceding ';'
ScribbleDoc.cpp
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2143: syntax error : missing ';' before '<'
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2501: 'CArray' : missing storage-class or type specifiers
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2059: syntax error : '<'
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2238: unexpected token(s) preceding ';'
ScribbleView.cpp
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2143: syntax error : missing ';' before '<'
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2501: 'CArray' : missing storage-class or type specifiers
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2059: syntax error : '<'
d:\mvs\myprojects\scribbe\scribble step1\scribbledoc.h(67) : error C2238: unexpected token(s) preceding ';'
Generating Code...
Error executing cl.exe.

Scribble.exe - 12 error(s), 0 warning(s)

搜索更多相关主题的帖子: collection public 声明 CStroke CDC 
2006-04-03 20:13
myajax95
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:30
帖 子:2978
专家分:0
注 册:2006-3-5
得分:0 
在stdafx.h中需要加上
#include "afxtempl.h"

http://myajax95./
2006-04-04 12:36



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-54874-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.117712 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved