[c++] - Help about class and error: C3861
- by Chelsea_cole
Can someone help me in this error?
in "cDef.h" :
#pragma once
class cDef
{
public:
static int STATE_LOGO;
static int STATE_MENU;
static int MESSAGE_ENTER;
static int MESSAGE_UPDATE;
static int MESSAGE_PAINT;
static int MESSAGE_EXIT;
};
in "GameState.h":
#pragma once
#ifndef _GameState_
#define _GameState_
#include "cDef.h"
class MainGame;
class GameState;
class GameState
{
public:
MainGame *mg;
int GAME_STATE_DEF;
virtual void MessengeEnter(int message) = 0;
virtual void MessengeUpdate(int message,int keys) = 0;
virtual void MessengePaint(int message,CDC *pDc) = 0;
void StateHandler(int message,CDC *pDc,int keys);
public:
GameState(void);
public:
~GameState(void);
};
#endif
in "GameState.cpp":
#include "StdAfx.h"
#include "GameState.h"
GameState::GameState(void)
{
GAME_STATE_DEF = -1;
}
GameState::~GameState(void)
{
}
void GameState::StateHandler(int message,CDC *pDc,int keys)
{
if(message == cDef.MESSAGE_ENTER)
{
MessageEnter(message);
}
if(message == cDef.MESSAGE_UPDATE)
{
MessageUpdate(message,keys);
}
if(message == cDef.MESSAGE_PAINT)
{
MessagePaint(message,pDC);
}
}
error:
warning C4832: token '.' is illegal after UDT 'cDef'
see declaration of 'cDef'
error C3861: 'MessageUpdate': identifier not found
error C3861: 'MessageEnter': identifier not found
error C3861: 'MessagePaint': identifier not found
.....
Thanks in advance!