| | |
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
- 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?
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






