title: Word wrap with DrawTextEx in MFC
body: <p>I need to draw text inside the rect. But when the text is long, it's clip out the extra text. I need to wrap the text, so that extra part of text which don't fits in the first line should goes to the next line.</p>
  
  <p>I have google it, there was a suggestion to use DrawTextEx() with DT_CALCRECT flag instead of DrawText(). But still it's not working, when I uses this flag I am not getting the text.</p>
  
  <pre><code>DRAWTEXTPARAMS lpDTParams;
  lpDTParams.cbSize        = sizeof(lpDTParams);
  lpDTParams.iLeftMargin   = 1;
  lpDTParams.iRightMargin  = 1;
  lpDTParams.iTabLength    = 4;
  lpDTParams.uiLengthDrawn = 0;
  
  pDC-&gt;DrawTextExA(sTemp, rc, DT_NOCLIP|DT_CENTER|DT_WORDBREAK|DT_CALCRECT, &amp;lpDTParams);
  </code></pre>
  
  <p>Any suggestion will be greatly appreciated.
  Thanks</p>