How to convert char/* to wchar_t/* ---but
<p>I'm converting an (rather)old C code into VS2010. Everything works fine when I compile program with multibyte option but I have to convert it into UNICODE.</p>

<p>I'm getting a lot of error messages related with string conversation (but it is not strange).
My problem is related with the fact that I have to work with wchar strings (because of UNICODE) but I also have to retain standard char values ( Program needs to write data into file with standard ascii code).</p>

<p>To be more clear, UNICODE is needed for working with Windows but files must be saved into ascii format. I receive errors on many places and that's why I've decided to put that question here.</p>

<p>May somoene suggest what's the best practice for this kind of problem?</p>

<p>Thank you in advance!</p>

<p>edit:</p>

<p>well , I'm not an expert for C/C++, this is my first large project. I've tried your suggestion from the first answer like this:                                                                    }</p>

<pre><code>    { 
TCHAR* strz1=_T("%u blocks converted.");
      if (n&gt;0) 
      {
      sprintf(str,strz1,n)
      }
      else
      TCHAR* strz2=_T("No blocks found!"); 
      sprintf(str,strz2);
      TCHAR* strz3=_T("Status");
      MessageBoxW(hwnd,str,strz3,MB_OK|MB_ICONINFORMATION);
      return(fe);
    }
</code></pre>

<p>Im getting famous errors:</p>

<p>error C2664: 'sprintf' : cannot convert parameter 2 from 'TCHAR *' to 'const char *'</p>

<p>error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [32]' to 'LPCWSTR'       </p>
