[EMAIL PROTECTED] wrote:
// the way I did this in earlier
TCHAR szValue[5];
wsprintf(szValue, TEXT("%li%%"), *Value);
mProgressBar->SetAttribute(NS_LITERAL_STRING("value"),
NS_ConvertUTF8toUCS2(szValue));

But now I need to use fronzen string API with nsEmbedString, which does
not offer NS_ConvertUTF8toUCS2.

It does offer NS_CStringToUTF16...
http://lxr.mozilla.org/seamonkey/source/xpcom/string/public/nsStringAPI.h#774


If you use Windows-specific APIs anyway, you could just use wsprintfW (unless you need compatibility with win9x/ME, which I don't think offer this function):
  WCHAR szValue[12];
  wsprintfW(szValue, L"%li%%", *Value);
  nsDependentString value(szValue);

-biesi
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to