我弄了个弹出对话框,myDlg dlg;
dlg.GetDlgItem(IDC_HDD)->SetWindowText("sajf");
dlg.DoModal(); 编译通过了,但是我单击按键时出现了错误。不能访问,请各位不吝赐教。
dlg.GetDlgItem(IDC_HDD)->SetWindowText("sajf");
dlg.DoModal(); 编译通过了,但是我单击按键时出现了错误。不能访问,请各位不吝赐教。
============
对话框还没出来呢,哪来的IDC_HDD啊
在dlg这个类的OnInitDialog中处理吧
去掉dlg.GetDlgItem(IDC_HDD)->SetWindowText("sajf");
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
GetDlgItem(IDC_HDD)->SetWindowText("sajf");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
加了,但弹出的窗口静态文本内容没有改变,怎么弄。
加一个
UpdateData(FALE);
if(dlg.DoModal());
{
dlg.GetDlgItem(IDC_HDD)->SetWindowText("sajf");
}