总是报错不知是什么原因!!!
在用CAsyncSocket作一个基于UDP的网络通信程序,作了一个派生类:
class CMySocket : public CAsyncSocket
{
public:
CMySocket();
virtual ~CMySocket();
protected:
CShou* m_pDoc; //这里报错
};
结果编译报错如下:
f:\c++\example\shou\shoudoc.h(22) : error C2143: syntax error : missing ';' before '*'
f:\c++\example\shou\shoudoc.h(22) : error C2501: 'CDASocket' : missing storage-class or type specifiers
f:\c++\example\shou\shoudoc.h(22) : error C2501: 'm_hSocket' : missing storage-class or type specifiers
一开始并没有出错,当我在class CShouDoc : public CDocument中加入变量
public:
CDASocket* m_hSocket;
就报出上面的错误,到底是什么问题啊?急!!请帮帮忙,谢谢