-
March 22nd, 2010, 02:20 PM
#1
Print int on msgbox
Here's the code:
MessageBox(NULL, I want to print int here, "caption", MB_ICONERROR);
how to convert int or DWORD or BYTE.....and print it on msgbox?
I know that it demands LPCSTR string as that parametar to print it.So how to convert it right there in order to print its value?
This should be an easy question.
-
March 22nd, 2010, 02:24 PM
#2
Re: Print int on msgbox
There are several ways to convert ints to strings. Pick one and use it before the messagebox call.
-
March 22nd, 2010, 03:00 PM
#3
-
March 22nd, 2010, 03:02 PM
#4
Re: Print int on msgbox
Here is an example:
Code:
int i = 42;
CString str;
str.Format(_T("%d"), i);
MessageBox(NULL, str, _T("caption"), MB_ICONERROR);
-
March 23rd, 2010, 01:51 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|