| | |
TextBox Value
Please support our C++ advertiser: Intel Parallel Studio Home
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
- 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)
- Can't update a textbox in Visual C++ (C++)
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?
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






