title: How to save the filename as timestamp with D3DXSaveTextureToFileW on C?
body: <p>Im having some probolems with C++ .. I'm trying to save a frame with the filename as timestamp but with no success, can anybody help me?</p>
  
  <p>It saves properly if i use: </p>
  
  <p><code>D3DXSaveTextureToFileW((LPCWSTR)"file.bmp",D3DXIFF_BMP,tex,NULL);</code> or      </p>
  
  <pre><code>D3DXSaveTextureToFileW(L"file.bmp", frameName,D3DXIFF_BMP,tex,NULL); 
  </code></pre>
  
  <p>But if I try some more elaborated filename I get some issues, it compiles but doesn't save the file ...</p>
  
  <p>I'm trying to use someting like </p>
  
  <pre><code>LPCWSTR frameName;
  std::string s = std::string("file") + std::string(".bmp");
  frameName = (LPCWSTR)s.c_str();
  D3DXSaveTextureToFileW((LPCWSTR)frameName,D3DXIFF_BMP,tex,NULL);
  </code></pre>
  
  <p>Doesn't save ... And If I try something like I want to save the problem continues:</p>
  
  <pre><code>time_t seconds;
  seconds = time (NULL);      
  time_t rawtime;
  time ( &amp;rawtime );
  
  LPCWSTR frameName;
  std::string s = std::string("file") + std::string(&amp;rawtime);
  frameName = (LPCWSTR)s.c_str();
  
  D3DXSaveTextureToFileW((LPCWSTR)frameName,D3DXIFF_BMP,tex,NULL);
  </code></pre>