更新一下自己的代码
int i = 0,j = 0;
void CWangLiuLin190304View::OnDraw(CDC* pDC)
{
CWangLiuLin190304Doc* pDoc = GetDocument();
if(j == 10) ::TextOut((pDC->GetSafeHdc()),0,0,"\n\r",lstrlen("\n\r"));//每10个换行
if(i == 1)
{
int a;
a = rand()%25;
a += 'a';
::TextOut((pDC->GetSafeHdc()),0,0,((CString)a),lstrlen((CString)a));
}
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
两段代码
void CWangLiuLin190304View::OnBegin()
{
// TODO: Add your command handler code here
SetTimer(1,500,NULL);
i = 1;
}
void CWangLiuLin190304View::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
j++;
if(i == 1)
{
CDC *pDC=GetDC(); //调用OnDraw(pDC)重画
OnDraw(pDC);
}
if(j == 99)
{
KillTimer(1);//100个结束
}
//CView::OnTimer(nIDEvent);
}
void CWangLiuLin190304View::OnEnd()
{
// TODO: Add your command handler code here
i = 0;
KillTimer(1);
}