一、IDC_EDIT 编辑控件函数
获取编辑控件的整数数值工具
int HRoberts = GetDlgItemInt(H_Roberts);
设置编辑控件上的整数数值调试
SetDlgItemInt(H_Roberts,12);
二、控制台打印调试信息code
添加一个头文件
blog
#include <conio.h>
string
在须要开启控制台窗口的地方调用
AllocConsole();
//注意检查返回值
在须要输出调试的时候调用_cprintf等函数
如_cprintf(
"i=%d\n"
, i);
三、单选框io
二、从控件获得选定的Item
假设在控件列表中已经选定某项,如今要获得被选定项的内容,首先要获得该项的位置,而后获得对应位置的内容。这里会用到两个函数,如:
int nIndex = m_cbExample.GetCurSel();
CString strCBText;
m_cbExample.GetLBText( nIndex, strCBText);
这样,获得的内容就保存在 strCBText 中。
若要选取当前内容,可调用函数GetWindowText(strCBText)。
class