主题:implement_serial()问题
我自己定义了一个类
#ifndef _INSIDE_VISUAL_CPP_STUDENT
#define _INSIDE_VISUAL_CPP_STUDENT
class CStudent :public CObject
{
DECLARE_SERIAL(CStudent)
public:
CString m_strName;
int m_nGrade;
、、、、、、、
#ifdef _DEBUG
void Dump(CDumpContext &dc)const;
#endif//_DEBUG
};
#endif
然后在CPP文件中
#include "stdafx.h"
#include "Student.h"
IMPLEMENT_SERIAL(CStudent,CObject,0)
#ifdef _DEBUG
void CStudent::Dump(CDumpContext&dc)
{
CObject::Dump(dc);
dc<<"m_strName="<<m_strName<<"\nm_nGrade="<<m_nGrade;
}
#endif
我把这个类添加到工程里出错如下:
'Dump' : overloaded member function 'void (class CDumpContext &)' not found in 'CStudent'
: see declaration of 'CStudent'
Error executing cl.exe.
大虾,帮我看看是怎么回事,我折腾了半天也没搞定
#ifndef _INSIDE_VISUAL_CPP_STUDENT
#define _INSIDE_VISUAL_CPP_STUDENT
class CStudent :public CObject
{
DECLARE_SERIAL(CStudent)
public:
CString m_strName;
int m_nGrade;
、、、、、、、
#ifdef _DEBUG
void Dump(CDumpContext &dc)const;
#endif//_DEBUG
};
#endif
然后在CPP文件中
#include "stdafx.h"
#include "Student.h"
IMPLEMENT_SERIAL(CStudent,CObject,0)
#ifdef _DEBUG
void CStudent::Dump(CDumpContext&dc)
{
CObject::Dump(dc);
dc<<"m_strName="<<m_strName<<"\nm_nGrade="<<m_nGrade;
}
#endif
我把这个类添加到工程里出错如下:
'Dump' : overloaded member function 'void (class CDumpContext &)' not found in 'CStudent'
: see declaration of 'CStudent'
Error executing cl.exe.
大虾,帮我看看是怎么回事,我折腾了半天也没搞定