VS 2013运行 C++ MFC,ListBox添加数据不显示问题,代码如下
CProp1是DiaLog类型IDD_PROP1关联的类
BOOL CProp1::OnInitDialog()
{
CPropertyPage::OnInitDialog();
((CListBox *)GetDlgItem(IDC_LIST1))->AddString(L"北京");
((CListBox *)GetDlgItem(IDC_LIST1))->AddString(L"上海");
((CListBox *)GetDlgItem(IDC_LIST1))->AddString(L"深圳");
// TODO: 在此添加额外的初始化
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
另外,我试着对控件关联过变量,但是一运行就会出错