回答編集履歴
1
追記
test
CHANGED
@@ -12,4 +12,17 @@
|
|
12
12
|
GetDlgItem(IDC_BMI)->SetWindowText(buffer); // EditBoxに書く
|
13
13
|
}
|
14
14
|
```
|
15
|
-
|
15
|
+
edit-controlがメンバ変数 editXXX_ にアタッチされているなら:
|
16
|
+
```C++
|
17
|
+
void CMFCApplication3Dlg::OnBnClickedButton1()
|
18
|
+
{
|
19
|
+
char buffer[100];
|
20
|
+
editWeight_.GetWindowText(buffer, 100);
|
21
|
+
double weight = _tstof(buffer);
|
22
|
+
editHeight_.GetWindowText(buffer, 100);
|
23
|
+
double height = _tstof(buffer) / 100;
|
24
|
+
double bmi = weight / height / height;
|
25
|
+
sprintf(buffer, "%lf", bmi);
|
26
|
+
editBMI_.SetWindowText(buffer);
|
27
|
+
}
|
28
|
+
```
|