Please observe the following code:
double rate=GetDlgItemInt(IDC_EDIT1,0,TRUE);
double term=GetDlgItemInt(IDC_EDIT2,0,TRUE);
double amount=GetDlgItemInt(IDC_EDIT3,0,TRUE);
double final;
CString Content(_T("Thanks for using the calculator"));
if (CTaskDialog::IsSupported())
{
CString Heading(_T("Successfully calculated"));
CString Title(_T("Interest Calculator"));
CString Collapsed(_T("Collapsed Info"));
CString Expanded(_T("Expanded Info"));
CString Information(_T("Your information you want to calculate"));
CTaskDialog dia(Content,Heading,Title,TDCBF_OK_BUTTON);
final=amount*pow((1+rate),term);
SetDlgItemInt(IDC_EDIT4,final,FALSE);
dia.SetMainIcon(TD_ERROR_ICON);
dia.DoModal();
}
}
What I have tried to do is to create a GUI for a calculator which calculates the future value of a fund. I want to have all the variables as doubles. But the part of the code "GetDlgItemInt" is clearly meant for integers and I do not know how to alter it to get a double. Please help me with this. Thanks in advance.