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. editbox to listbox problem...

editbox to listbox problem...

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 3 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.
  • N Offline
    N Offline
    Neil Jigger
    wrote on last edited by
    #1

    what is the exact code to get the value of the editbox (variable type double) and displays in the listbox? i tried : m_list.GetText(m_list.GetCurSel(), m_edit1) and m_list.GetText(m_edit1) but after building committed errors... please help.

    D 1 Reply Last reply
    0
    • N Neil Jigger

      what is the exact code to get the value of the editbox (variable type double) and displays in the listbox? i tried : m_list.GetText(m_list.GetCurSel(), m_edit1) and m_list.GetText(m_edit1) but after building committed errors... please help.

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

      Neil Jigger wrote:

      what is the exact code to get the value of the editbox (variable type double) and displays in the listbox?

      CString str;
      m_edit.GetWindowText(str);
      m_listbox.AddString(str);

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      N 1 Reply Last reply
      0
      • D David Crow

        Neil Jigger wrote:

        what is the exact code to get the value of the editbox (variable type double) and displays in the listbox?

        CString str;
        m_edit.GetWindowText(str);
        m_listbox.AddString(str);

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        N Offline
        N Offline
        Neil Jigger
        wrote on last edited by
        #3

        --------------------Configuration: g - Win32 Debug-------------------- Compiling... gDlg.cpp C:\Program Files\Microsoft Visual Studio\MyProjects\g\gDlg.cpp(179) : error C2039: 'GetWindowTextA' : is not a member of 'CString'             c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Error executing cl.exe. g.exe - 1 error(s), 0 warning(s) still i cannot get the right code...

        C 1 Reply Last reply
        0
        • N Neil Jigger

          --------------------Configuration: g - Win32 Debug-------------------- Compiling... gDlg.cpp C:\Program Files\Microsoft Visual Studio\MyProjects\g\gDlg.cpp(179) : error C2039: 'GetWindowTextA' : is not a member of 'CString'             c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Error executing cl.exe. g.exe - 1 error(s), 0 warning(s) still i cannot get the right code...

          C Offline
          C Offline
          Chandrasekharan P
          wrote on last edited by
          #4

          Yes.. SetWindowText is not a member of CString. I assume you are using a textbox. make a variable of control type. Something like this

          CEdit m_edit

          and then compile the code.Hope this helps.

          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