xboxscene.org forums

OG Xbox Forums => Software Forums => Development => Topic started by: Dents on September 22, 2004, 10:27:00 AM

Title: Going From Short To Wchar
Post by: Dents on September 22, 2004, 10:27:00 AM
CODE

wchar_t buf[40];
wsprintfW(buf, L"Resolution: %lu by %lu", dm.Width, dm.Height);

Title: Going From Short To Wchar
Post by: BenJeremy on September 22, 2004, 11:18:00 AM
I use a modified version of CStdString (from CodeProject) in MXM to handle conversion back and forth.

Also, as good practice, use _T() around quoted text and character literals, as well as _txxxx functions.

The CStdString template makes things a bit easier, since there's no CString for the XDK, but you also have to remember that when using parameters in printf()-style formatting calls, with multiple arguments, to explicitly use the .c_str() operator of the string, to force the conversion to the proper type.
Title: Going From Short To Wchar
Post by: blueshogun96 on September 28, 2004, 11:18:00 AM
mad.gif

EDIT: Nevermind, I fixed it.  Sorry for bumping this thread