#include <afxwin.h>
class CPT : public CObject
{
public:
double x,y;
COLORREF c;
public:
CPT();
CPT( double srx, double sry, COLORREF src){
CPT::x= srx;
CPT::y= sry;
CPT::c= src;
}
public:
double GetCPTX() {
return CPT::x;
}
double GetCPTY() {
return CPT::y;
}
COLORREF GetCPTC() {
return CPT::c;
}
virtual void Serialize(CArchive &ar){
if( ar.IsStoring())
{
ar<< CPT::x << CPT::y
<< CPT::c;
}
else{
ar>> CPT::x >> CPT::y
>> CPT::c;
}
}
};
Wrong:
--------------------Configuration: TPX - Win32 Debug--------------------
Compiling...
CWin.cpp
f:\tpx\workout.h(3) : error C2011: 'CPT' : 'class' type redefinition
执行 cl.exe 时出错.
TPX.exe - 1 error(s), 0 warning(s)
为什么会说CPT被重复定义了,我即使改一下CPT也是这样报错。
怎样处理。