用MFC编了一贪吃蛇游戏,被卡住了。。。纯菜鸟。。。看不懂求助啊啊!!
#include<afxtempl.h>#include<afxwin.h>classCSnakeGame:publicCWnd{public:CSnakeGame();...
#include<afxtempl.h>
#include <afxwin.h>
class CSnakeGame : public CWnd
{
public:
CSnakeGame();
virtual ~CSnakeGame();
bool GameStart();
void InitFoods();
void SetGameLevel(int level);
void InitGame();
private:
CPoint m_psFood;
int m_nDirect;
int m_nScore;
int m_nLevel;
CArray<CPoint,CPoint> m_body;
protected:
void OnPaint();
void OnKeyDown(UINT nChar,UINT nRepCnt,UINT nFlags );
void OnTimer(UINT nTimerID);
DECLARE_MESSAGE_MAP()
};
报错:g:\small term\snake\snakegame.h(35) : error C2236: unexpected 'class' 'CSnakeGame'
我依然崩溃了。试了各种办法 展开
#include <afxwin.h>
class CSnakeGame : public CWnd
{
public:
CSnakeGame();
virtual ~CSnakeGame();
bool GameStart();
void InitFoods();
void SetGameLevel(int level);
void InitGame();
private:
CPoint m_psFood;
int m_nDirect;
int m_nScore;
int m_nLevel;
CArray<CPoint,CPoint> m_body;
protected:
void OnPaint();
void OnKeyDown(UINT nChar,UINT nRepCnt,UINT nFlags );
void OnTimer(UINT nTimerID);
DECLARE_MESSAGE_MAP()
};
报错:g:\small term\snake\snakegame.h(35) : error C2236: unexpected 'class' 'CSnakeGame'
我依然崩溃了。试了各种办法 展开
1个回答
2011-09-10
展开全部
DECLARE_MESSAGE_MAP()后面该有分号吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询