Thanks - I used this code:
Code:
case IDC_ADD: //Pressing the 'add' button.
{
int len = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT));
int len2 = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT2));
char* buf;
char* buf2;
buf = (char*)GlobalAlloc(GPTR, len + 1);
buf2 = (char*)GlobalAlloc(GPTR, len2 + 1);
GetDlgItemText(hwnd, IDC_TEXT, buf, len + 1);
GetDlgItemText(hwnd, IDC_TEXT2, buf2, len2 + 1);
Third=atof(buf)+atof(buf2);
char strFirst[100];
sprintf(strFirst,"%0.0f",Third);
SetDlgItemText(hwnd, IDC_TEXT3, strFirst);
break;