Edit box string
-
Hi All, How do I get the information that a user enters from a edit box? I want to open a file that the user enters...so basically i want to get the string entered by the user into the open file call. Many thanks in advance.
-
Hi All, How do I get the information that a user enters from a edit box? I want to open a file that the user enters...so basically i want to get the string entered by the user into the open file call. Many thanks in advance.
void GetWindowText( CString& rString ) const; or if you assigned a CString variable to the Edit box, use UpdateData(TRUE) and the variable should contain the text.
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
-
Hi All, How do I get the information that a user enters from a edit box? I want to open a file that the user enters...so basically i want to get the string entered by the user into the open file call. Many thanks in advance.
Use GetWindowText() in MFC or handle the WM_GETTEXT message in win32
If you can keep you head when all about you Are losing theirs and blaming it on you; If you can dream - and not make dreams your master; If you can think - and not make thoughts you aim; Yours is the Earth and everything that's in it. Rudyard Kipling
-
Hi All, How do I get the information that a user enters from a edit box? I want to open a file that the user enters...so basically i want to get the string entered by the user into the open file call. Many thanks in advance.
Thanks everyone....I was using GetLine, didn't realize until right now that was only for multiple line boxes. can you tell i am new to programming?!?!?! In another case, I will have a number. Is there a way to determine if this number is a negative? How do I just look at the first character in the string?
-
Thanks everyone....I was using GetLine, didn't realize until right now that was only for multiple line boxes. can you tell i am new to programming?!?!?! In another case, I will have a number. Is there a way to determine if this number is a negative? How do I just look at the first character in the string?
Use atoi() for an int or atof() for a float and check if the number is less than zero.
CString str = "-9"; int value = atoi(str); if (value < 0) { ..... ..... }
-
Use atoi() for an int or atof() for a float and check if the number is less than zero.
CString str = "-9"; int value = atoi(str); if (value < 0) { ..... ..... }
-
Thanks everyone....I was using GetLine, didn't realize until right now that was only for multiple line boxes. can you tell i am new to programming?!?!?! In another case, I will have a number. Is there a way to determine if this number is a negative? How do I just look at the first character in the string?
Jay Hova wrote: can you tell i am new to programming?!?!?! Not unless you tell us! Even experienced folks forget stuff now and then.
-
Thanks.... Is there a place where I can find all these types of conversion "tool/methods"? I know what this one does (atoi) but I know there are other ones that I may find useful. Many thanks again.
Look on your MSDN Library CD