Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Edit box string

Edit box string

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 Posts 6 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jay Hova
    wrote on last edited by
    #1

    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.

    RaviBeeR M A J 4 Replies Last reply
    0
    • J Jay Hova

      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.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      CString strFilename; m_edit.GetWindowText (strFilename); /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

      1 Reply Last reply
      0
      • J Jay Hova

        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.

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        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 )

        1 Reply Last reply
        0
        • J Jay Hova

          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.

          A Offline
          A Offline
          Andrew Walker
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • J Jay Hova

            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.

            J Offline
            J Offline
            Jay Hova
            wrote on last edited by
            #5

            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?

            V D 2 Replies Last reply
            0
            • J Jay Hova

              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?

              V Offline
              V Offline
              vcplusplus
              wrote on last edited by
              #6

              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) { ..... ..... }

              J 1 Reply Last reply
              0
              • V vcplusplus

                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) { ..... ..... }

                J Offline
                J Offline
                Jay Hova
                wrote on last edited by
                #7

                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.

                V 1 Reply Last reply
                0
                • J Jay Hova

                  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?

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  Jay Hova wrote: can you tell i am new to programming?!?!?! Not unless you tell us! Even experienced folks forget stuff now and then.

                  1 Reply Last reply
                  0
                  • J Jay Hova

                    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.

                    V Offline
                    V Offline
                    vcplusplus
                    wrote on last edited by
                    #9

                    Look on your MSDN Library CD

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups