【急】MFC的2个ERRROR求指导~谢谢!
error1:error C2146: syntax error : missing ';' before identifier 'GetDocument' childview.h line 35
error2:error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
childview.h line 35
【childview.h中】
class CChildView : public CView
{
// 构造
public:
int ManChoice,ManTurn,ComChoice,ComTurn;
CBitmap m_black;//CBitmap是afxwin.h中的一个类,可以调用bitmap,黑子
CBitmap m_white;//白子
CBitmap m_board;//棋盘
//CBitmap m_last;//悔棋
//CChildfind m_find;//搜索深度
private:
protected:
public:
CChildView();
DECLARE_DYNCREATE(CChildView)
// 属性
public:
CChildDoc GetDocument(void);【此处出错】
// 操作
public:
void OnDraw(CDC *pDC);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// 重写
protected:
// 实现
public:
virtual ~CChildView();
// 生成的消息映射函数
protected:
DECLARE_MESSAGE_MAP();
//public:
};
【childDoc.h中】
class CChildDoc : public CDocument//一个冒号用于初始化列表,此处是通过CDocument初始化CChildDoc
{
public:
protected:
CChildDoc();
DECLARE_DYNCREATE(CChildDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
public:
virtual ~CChildDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CBwDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
【childDoc.cpp中】
CChildDoc::CChildDoc()
{
// TODO: add one-time construction code here
}需要写点什么吗?
附件是可能涉及到的完整相关代码,望各位高手指点,谢谢。QQ380781038~
chess.rar
(2.46 KB)