title: Drawing Text with GDI+
body: <p>I have searched for some days now to find a possibility to display text on my GDI+ application.</p>
  
  <p>I tried using the <code>DrawString()</code> function of GDI+ but the reference on MSDN does not work as it does not match with the parameter list. I am using Visual C++ 2010 Express.</p>
  
  <p>I changed the MSDN example to make it compile, like this:</p>
  
  <pre><code>LinearGradientBrush* myBrush = new LinearGradientBrush(Rect(0,0,width,height),Color::Red, Color::Yellow, LinearGradientMode::LinearGradientModeHorizontal);
  Font* myFont = new Font(hdc);
  RectF rect = RectF(10,10,100,100);
  graphics.DrawString(TEXT("Look at this text!"),100, myFont,rect,&amp;StringFormat(0,0), myBrush);
  </code></pre>
  
  <p>I also tried two other functions:</p>
  
  <pre><code>TextOut(hdc,10,10,TEXT("Text"),6);
  DrawText(hdc,TEXT("Text"),0,LPRECT(0),0);
  </code></pre>
  
  <p>None of them shows a text on the screen. Drawing lines, ellipses, etc. works with no problems.</p>
  
  <p>Why doesn't the above text-drawing routine work? Can anybody provide a working example?</p>