title: error C2664: 'wsprintfW' : cannot convert parameter 1 from 'char *' to 'LPWSTR'
body: <p>I copied some code from a VC6 project to a vc++2010 project, but the code cannot be compiled.
   the error is <strong>'wsprintfW' : cannot convert parameter 1 from 'char *' to 'LPWSTR'</strong>, problem code is:</p>
  
  <pre><code>inline bool RingCtrl::BuildPathAndName(char* pBuf, int bufSize, int8 priority, int idxNumber) const
  {
      wsprintf(pBuf, "%s\\R%u%06x.DAT", _directory, (int)priority, idxNumber);
      return true;
  }
  </code></pre>
  
  <p>the <code>wsprintf</code> is defined in <code>wmcommn.h</code> like below:</p>
  
  <pre><code>WINUSERAPI
  int
  WINAPIV
  wsprintfA(
      __out LPSTR,
      __in __format_string LPCSTR,
      ...);
  WINUSERAPI
  int
  WINAPIV
  wsprintfW(
      __out LPWSTR,
      __in __format_string LPCWSTR,
      ...);
  #ifdef UNICODE
  #define wsprintf  wsprintfW
  #else
  #define wsprintf  wsprintfA
  #endif 
  </code></pre>