IDC与变量关联

方法很多:
其中一种容易说的
int num1;
char ch1[15]; // 如果数据会很长的话就设大点
GetDlgItem(IDC_EDIT1)->GetWindowText(ch1,15);
num1=atoi(ch1);
其中IDC_EDIT1是对话框ID,num1是你想要的数据。
向对话框写数据
itoa(num1,ch1,10); // 10表示十进制
GetDlgItem(IDC_EDIT1)->SetWindowText(ch1);


posted on 2013-09-03 22:58  dhkdhk  阅读(146)  评论(0)    收藏  举报