level 1
吾吾如泪1o
楼主
class CMsgTestDoc : public CDocument
{
protected: // 仅从序列化创建
CMsgTestDoc();
DECLARE_DYNCREATE(CMsgTestDoc)
// 属性
public:
// 操作
public:
// 重写
public:virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
// 实现
public:
virtual ~CMsgTestDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// 生成的消息映射函数
protected:
DECLARE_MESSAGE_MAP()
private:
// 鼠标光标的 x 坐标
int m_PosX;
// 鼠标光标的 y 坐标
int m_PosY;
// 窗口的高度
int m_Height;
// 窗口长度
int m_Width;
public:
void SetPosX(int x);
void SetPosY(int y);
void SetHeight(int h);
void SetWidth(int w);
};
===============================================================================
// CMsgTestDoc 命令
void CMsgTestDoc::SetPosX(int x)
{
m_PosX = x;
UpdateAllViews(NULL);
}
void CMsgTestDoc::SetPosY(int y)
{
m_PosY = y;
UpdateAllViews(NULL);
}
void CMsgTestDoc::SetHeight(int h)
{
m_Height = h;UpdateAllViews(NULL);
}
void CMsgTestDoc::SetWidth(int w)
{
m_Width = w;UpdateAllViews(NULL);
}
int CMsgTestDoc::GetPosX(void)
{
return m_PosX;
}
int CMsgTestDoc::GetPosY(void)
{
return m_PosY;
}
int CMsgTestDoc::GetHeight(void)
{
return m_Height;
}
int CMsgTestDoc::GetWidht(void)
{return m_Width;
}
==========================================
有错误 求解
红点那里是 出错的 地方





