| | |
TextBox Value
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jan 2009
Posts: 68
Reputation:
Solved Threads: 0
Hi,
How can I show a long value returned from a function to a textbox on a dialog box.
Void CVideoDlg::OnBnClickedFrames()
{
m_AMC.get_FramesDrawn(); // retunrs long
}
I want to display the returned value in textbox as well as a messagebox.
I tried MessageBox(CString(m_AMC.get_FramesDrawn()));
But it didn't work out
anyone can help with that
thx
How can I show a long value returned from a function to a textbox on a dialog box.
Void CVideoDlg::OnBnClickedFrames()
{
m_AMC.get_FramesDrawn(); // retunrs long
}
I want to display the returned value in textbox as well as a messagebox.
I tried MessageBox(CString(m_AMC.get_FramesDrawn()));
But it didn't work out
anyone can help with that
thx
you need to use CString's Format() method. It works exactly like printf().
C++ Syntax (Toggle Plain Text)
CString txt; txt.Format("%d", m_AMC.get_FramesDrawn())); MessageBox(txt, MB_OK);
Last edited by Ancient Dragon; Apr 14th, 2009 at 10:32 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
you are compiling for UNICODE, so param1 should be
L"%d" to force the conversion of the string to wchar_t*. Or it might be preferable to use _TEXT("%d") so that you can turn off UNICODE if you want to and not have to change that line. Last edited by Ancient Dragon; Apr 14th, 2009 at 11:35 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Jan 2009
Posts: 68
Reputation:
Solved Threads: 0
•
•
•
•
you need to use CString's Format() method. It works exactly like printf().
C++ Syntax (Toggle Plain Text)
CString txt; txt.Format("%d", m_AMC.get_FramesDrawn())); MessageBox(txt, MB_OK);
How can I display the output value in an edit box?
thanks
![]() |
Similar Threads
- Can't update a textbox in Visual C++ (C++)
- Picture in TextBox (C#)
- Picturebox / Textbox (Visual Basic 4 / 5 / 6)
- Checking for a blank textbox (C++)
- validating a textbox without using validation control (ASP.NET)
- Printing a textbox? (C#)
- Add textbox to editable div problem (JavaScript / DHTML / AJAX)
- TextBox - how to determine focus (ASP.NET)
Other Threads in the C++ Forum
- Previous Thread: Detecting a mouse click in an area
- Next Thread: How can i use the defined functions into the forms?
Views: 647 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll dynamic encryption error file forms fstream function functions game givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort stream string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






