title: Draw changeable text with CDC::DrawText
body: <p>I want to show on the screen some value, that are changeable. I have following code</p>
  
  <pre><code>void CMainWnd::OnPaint()
  {
      CPaintDC dc(this);
      CRect rcText( 0, 0, 500 ,500 );
  
      wchar_t text[36];       
      unsigned int num = server-&gt;GetNumClients(num);
      wsprintf(text, L"Number of connected clients: %d", num);
  
      dc.DrawText(text, &amp;rcText, DT_LEFT);
      CFrameWnd::OnPaint();
  }
  
   void CMainWnd::OnTimer(UINT timerID)
   {
       SendMessage(WM_PAINT, 0, 0);
   }
  </code></pre>
  
  <p>It draws text when window appears. But in next calls when text is different the text on the screen didn't change. Using the debugger I can see that OnPaint was called,  <em>text</em> has been changed, but on my window text remains the same. GetLastError() returns 0. I think I'm missing something important how DrawText works. I tried to call UpdateWindow() in the end, but nothing changed. For some reason screen is not updates..</p>