Set static label text to a double, Win32 C++

Hi all,

I'm trying to use WM_SETTEXT to assign a double to a static window, within
my Win32 application using VC++. Not sure if I'm going about this the right way,
all I want to do is print a double on the application window.

using namespace std;
const double x = 2.3333;
string y = double2string(x);
LPARAM a = (LPARAM) y.c_str();

SendMessage(hwndEdit,WM_SETTEXT,NULL,(LPARAM) a);

//this compiles, but displays 3 squares instead of "2.3333"

-Thanks
std::string double2string(const double i)
{
std::ostringstream stream;
stream << i;
return stream.str();
}
Topic archived. No new replies allowed.