I'm trying to convert a variables entered in as a CEdit to a CString, doing some standard error checking, then later to a string to pass to another api. Does anyone know the functions to do this?
I'm trying to convert a variables entered in as a CEdit to a CString, doing some standard error checking, then later to a string to pass to another api. Does anyone know the functions to do this?
Have you tried MSDN? Looks like the GetLine member might help, but it doesn't take a CString. You might have to allocate a regular character buffer and construct a CString off that...
(Disclaimer: Never used MFC. )
long time; /* know C? */
Unprecedented performance: Nothing ever ran this slow before.
Any sufficiently advanced bug is indistinguishable from a feature.
Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
The best way to accelerate an IBM is at 9.8 m/s/s.
recursion (re - cur' - zhun) n. 1. (see recursion)
I'm trying to basically just get the input down to a string to throw into a networking api.
I know how to convert a CString to a String:
but this CEdit box is killing me.Code:CString cs("Hello"); std::string s((LPCTSTR)cs);
Wow that was stupid I totally missed the question...
Yeah you use GetDlgItemText( CString, Control ID )
Sorry that was a totally unhelpful answer before...
Last edited by dpro; 01-18-2006 at 07:24 PM.
GetDlgItemText() takes a CString.
GetDlgItemText(IDC_SOME_EDIT,String);
or
CEdit SomeEdit;
CString String;
SomeEdit.GetWindowText(String);
Last edited by novacain; 01-18-2006 at 07:03 PM.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill