How can i write in Messagebox double or int numbers ?
I want to do like this...
//...
string s1="You have ";
string s2=" messages.";
string s;
for(int i= 0 ;i<10;i++)
{
stringstream os;
os<<i;
s=s1+os.str()+s2;
MessageBox(NULL,...,L"Blah blah",MB_YESNO);
}
//...
What should i write instead of ...?
How can I convert from string to const wcar_t * ?
Please tell me
P.S. And sorry for my english.
I know that but MessageBox wants const wchar_t * not const char *...
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'
Thanx very much that helps me but however when i compile with visual studio 6.0 i can write in message box
MessageBox(NULL,s.c_str(),L"Blah blah",MB_YESNO);
and i havn't got any errors but when i compile with vs 9.0 i've got an error.
when i compile with visual studio 6.0 i can write in message box
MessageBox(NULL,s.c_str(),L"Blah blah",MB_YESNO);
and i havn't got any errors but when i compile with vs 9.0 i've got an error.
VS6 is not defaulting to Unicode.
VS9 is.
MessageBox(NULL,s.c_str(),L"Blah blah",MB_YESNO); is wrong in any event. guestgulkan is correct -- you should be using MessageBoxA.