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. How to get the text string in the edit box?

How to get the text string in the edit box?

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebuggingtutorial
2 Posts 2 Posters 0 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.
  • A Offline
    A Offline
    AceZhou
    wrote on last edited by
    #1

    :confused: Maybe this question sounds a little stupid. But I really had some trouble getting the text string I typed in the edit box. It is just 1 line string. I used this function: iLength = SendMessage(hwndEditBox, EM_GETLINE, 0, (LPARAM) szBuffer); I supposed that it should be working. But I used the debugger to check the string. There is nothing in szBuffer. I used this function iCount = SendMessage(hwndEditBox, EM_LINELENGTH, 0, 0); the return value is right. So, how can I get the text string out of the edit box? Thanks! I am waiting online.

    G 1 Reply Last reply
    0
    • A AceZhou

      :confused: Maybe this question sounds a little stupid. But I really had some trouble getting the text string I typed in the edit box. It is just 1 line string. I used this function: iLength = SendMessage(hwndEditBox, EM_GETLINE, 0, (LPARAM) szBuffer); I supposed that it should be working. But I used the debugger to check the string. There is nothing in szBuffer. I used this function iCount = SendMessage(hwndEditBox, EM_LINELENGTH, 0, 0); the return value is right. So, how can I get the text string out of the edit box? Thanks! I am waiting online.

      G Offline
      G Offline
      godbert
      wrote on last edited by
      #2

      U ve got two options.Either u can associate ur edit box with a CString (via classwizard when u create ur ressource for example).Normally u type ur string and when u close the dialog box ur sring is stored in ur CString.OR the other solution is 2 associate ur edit box with a Cedit object and to use the member function "GetWindowText()".I don t know if what I m saying is of any help 4 u, but good luck anyway sysy

      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