Sunday, May 17, 2009

Converting CString to double in MFC

You can use the following snippet to convert CString to double in MFC:

#include "stdlib.h"

double func(CString pValue)
{
wchar_t* stopString;
double num = wcstod(pValue, &stopString);
return num;
}