Need help.. some MFC function
-
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..
-
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..
-
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..
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.
-
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
-
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
Maybe something like this: int i = 10; float f = 0.0; f = (float) i;