I would like to display an int value in a win32 MessageBox. I have read some different methods to perform this cast. Can someone provide me with a good implementation.
New to Win32 programming so go easy :)
update
So this is what i have so far. It works.. but the text looks like Chinese or some other double byte characters. I am not groking the Unicode vs. not Unicode types. Can someone help me understand where I am going wrong?
int volumeLevel = 6; std::stringstream os; os<<volumeLevel; std::string intString = os.str(); MessageBox(plugin.hwndParent,(LPCTSTR)intString.c_str(), L"", MB_OK);
wostringstreamfor Unicode.)LPC*T*STRsuggests), you'll have to use#ifdef UNICODE typedef wostringstream tstringstream #else typedef ostringstream tstringstream #endifLPCTSTRis a typedef toconst char*orconst wchar_t*depending on whetherUNICODEor_UNICODEhas been defined. You can get aconst char*from astd::stringor aconst wchar_t*from astd::wstringvia thec_str()method ofstring/wstring.