View.cpp:
view.cpp:
void CMy1View::OnDraw(CDC* pDC)
{
CMy1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
/*CRect rect;
this->GetWindowRect(&rect);
int x = rect.Width() / 2;
int y = rect.Height() / 2;
str.Format("计数%d",pDoc->num);
pDC->TextOut(x,y,str); */
//My001 str("寒冰",100);
//str.Display(pDC,20,20);
CWinApp *pW=::AfxGetApp();
CMy09App *pM=(CMy09App *)pW;
pDC->TextOut(10,10,pM->str);
int nCount=1,x=10,y=10,temp=10;
CString str;
for(;nCount<101;++nCount)
{
str.Format ("%d",nCount);
pDC->TextOut(x,y,str);
x+=30;
if(nCount==temp)
{
y+=30;
temp+=10;
x=10;
}
}
// TODO: add draw code for native data here
}
//还需在view.h里定义变量num