Here's an example of using strtod(). It seems to work for values from 1e-300 to 1e300. I goes a little freaky if I input 1e1000000000 or something similarly small, but that's probably because I don't know how to handle HUGE_VAL or use errno, etc.
Note: I assume you know that if the input in the GUI isn't in the form of a Cstyle string, you will need to convert it to a C style string in order to use strtod().
using namespace std;
const int MAX = 1000;
bool invalid = true;
cout << "Please enter a number : ";
cin >> input;
result = strtod(input, &p);
//if user pushed the enter key before other input, input is invalid
//if value of p is newline char or null char then all char entered by user were valid.
if(input != '\n' && (*p == '\n' || *p == '\0'))
cout << result << " is valid input" << endl;
invalid = false;
cout << "Invalid input." << endl;
cout << endl;
cin >> ch;