title: Directx9 Font Update with int to LPCTSTR conversion
body: <p>I'm trying to show the score on the screen. Following code works fine:</p>
  
  <pre><code>g_Font = NULL;
  D3DXFONT_DESC f = {fontSize,
                      0,
                      400,
                      0,
                      false,
                      DEFAULT_CHARSET,
                      OUT_TT_PRECIS,
                      CLIP_DEFAULT_PRECIS,
                      DEFAULT_PITCH,
                      fontName};
  fontDesc = f;
  fontPosition.top = top;
  fontPosition.left = left;
  fontPosition.right = right;
  fontPosition.bottom = bottom;
  text = t;
  D3DXCreateFontIndirect(device,&amp;fontDesc,&amp;g_Font);
  </code></pre>
  
  <p>Following part is rendered for each frame:</p>
  
  <pre><code>g_Font-&gt;DrawText(NULL,
          text,
          -1,
          &amp;fontPosition,
          DT_CENTER,
          0xffffffff); //draw text
  </code></pre>
  
  <p>What I want to do is, update the text during runtime. I simply update the text variable since drawing code runs for each frame, but it doesn't work. A simple text works but following construction doesn't work:</p>
  
  <pre><code>const size_t buflen = 100;
  TCHAR buf[buflen];
  _sntprintf(buf, buflen - 1, TEXT("Point: %d"), point);
  text = (LPCTSTR)buf;
  </code></pre>
  
  <p>I tried almost every solution I could have found online, but they don't work. I can see that the integer is converted successfully, but there are absurd characters in the following rendering. Any solutions?</p>