staticint repaintcount;//keeps count of repaint
CString convertInt;
repaintcount++;
convertInt.Format(TEXT("%d"),repaintcount);//converts repaintcount integer to string
CPaintDC dc (this); //gets current device context
dc.TextOut(0,0,TEXT(convertInt));//writes a character string at the specified location
}