PDA

View Full Version : Can i convert from CStrin to double



Bsbosa.com
07-13-2010, 04:07 AM
Hi sir,
I am doing some mathematical calculation.
where i am reading values from Dialog edit box control.
Here is .h file
ex.h
Dialog Data
//{{AFX_DATA(CSourceDetails)
enum { IDD = IDD_DIALOG_SOURCE_DETAILS };

CMSMask m_val1;
CMSMask m_val2;
CMSMask m_val3; here is .cpp file
m_val1.GetText(); // I am reading from the editbox
m_val2.GetText();
m_val3.GetText();
I am using this exp to get the result
A = B Exp(-0.693 * t/T)
B = m_val1.GetText();
t = m_val2.GetText();
T = m_val3.GetText(); I am trying with this.


h = (-0.693 * t/T);
res = B^h;
Can i pass the values(B,t an T) directly to the expression and get the result or i convert it to double(using atof).

Thanks
Raj