Sorry for my English.
I need to convert double value to CString, because i need to do AfxMessageBox(double_value);
I find this:
std::ostringstream ost;
ost << double_value;
std::cout << "As string: " << ost.str() << std::endl;
//AfxMessageBox(ost.str()); - Does not work.
How i can do this?
AfxMessageBox expects a CString object, so format the double into a CString and pass that:
CString str;
str.Format("As string: %g", double);
AfxMessageBox(str);
Edit: If you want the value displayed as an integer (no value after decimal point) then use this instead:
str.Format("As string: %d", (int)double);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With