16,551
社区成员
发帖
与我相关
我的任务
分享
void CMy76Doc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
ar<<m_strText;
}
else
{
// TODO: add loading code here
ar<<m_strText;
}
}
void CMy76View::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
CMy76Doc *pDoc=GetDocument();
m_str=pDoc->m_strText;
UpdateData(false);
}
void CMy76View::OnDraw(CDC* pDC)
{
CMy76Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDC->TextOut(0,0,m_str);
// TODO: add draw code for native data here
}
void CMy76View::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if (nChar=='\b')
m_str.Delete(m_str.GetLength()-1,1);
else
m_str+=nChar;
Invalidate();
CMy76Doc *pdoc=GetDocument();
pdoc->m_strText=m_str;
pdoc->SetModifiedFlag(true);
CView::OnChar(nChar, nRepCnt, nFlags);
}