edit control - testing input

This is a discussion on edit control - testing input within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I've made MFC application that performs calculations with numbers entered from edit controls.
For example:
Code:
...
CString var1,var2;
...

Problem arises when user enters some characters or string
when he's supposed to enter number.
For example value 5.52 is expected and user enters "dfsd". Function atof() will work and I'll get some dummy values in further calculations.
My question is how to check if value that is entered (in form string) really number or not?

Is there any way to check what is entered and to notify user to try again if number is not enetered.
Thanks for help!