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. Need help.. some MFC function

Need help.. some MFC function

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    As we know.. MFC have the GetDlgItemText function to retrieves the string (char datatype) and GetDlgItemInt function to translate the text into integer value. (integer datatype) But I wonder is there any function for Float datatype? If you know .. please explain along with the parameter within the function. Thanks..

    L F 2 Replies Last reply
    0
    • L Lost User

      As we know.. MFC have the GetDlgItemText function to retrieves the string (char datatype) and GetDlgItemInt function to translate the text into integer value. (integer datatype) But I wonder is there any function for Float datatype? If you know .. please explain along with the parameter within the function. Thanks..

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      No there is not such function, but you can use atof() to convert the string you got from GetDlgItemText() to a float hope this helps regards Gregor

      L 1 Reply Last reply
      0
      • L Lost User

        As we know.. MFC have the GetDlgItemText function to retrieves the string (char datatype) and GetDlgItemInt function to translate the text into integer value. (integer datatype) But I wonder is there any function for Float datatype? If you know .. please explain along with the parameter within the function. Thanks..

        F Offline
        F Offline
        Felix Cho
        wrote on last edited by
        #3

        I would have to say that this is one of the cases that you may want to use the DDX_ functions. One of the overrides does exactly just that. But there are limitations to those functions so if you are hitting on those limitations, you may still have to roll your own code.

        1 Reply Last reply
        0
        • L Lost User

          No there is not such function, but you can use atof() to convert the string you got from GetDlgItemText() to a float hope this helps regards Gregor

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I would like to convert the integer value to float value. I got some error when I used atof function. Do u know any function that same as atof() that convert integer to float? Thanks a lot. Lee Teong

          R 1 Reply Last reply
          0
          • L Lost User

            I would like to convert the integer value to float value. I got some error when I used atof function. Do u know any function that same as atof() that convert integer to float? Thanks a lot. Lee Teong

            R Offline
            R Offline
            Rick Crone
            wrote on last edited by
            #5

            Maybe something like this: int i = 10; float f = 0.0; f = (float) i;

            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