MFC中GetDlgItemText()函数需要添加什么头文件吗
新建了一个基本对话框,添了两个按钮和一个编辑框并加入以下代码voidCMy11Dlg::OnButton1(){//TODO:Addyourcontrolnotifica...
新建了一个基本对话框,添了两个按钮和一个编辑框并加入以下代码
void CMy11Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
CFile file;
CString str;
GetDlgItemText(IDC_EDIT,str);
file.Open("1.doc",CFile::modeWrite|CFile::modeCreate);
file.Write(str,str.GetLength());
file.Close();
}
GetDlgItemText
void CMy11Dlg::OnButton2()
{
// TODO: Add your control notification handler code here
CFile file;
char str[1000]={"\0"};
file.Open("1.doc",CFile::modeRead);
file.Read(str,file.GetLength());
file.Close();
SetDlgItemText(IDC_EDIT,str);
}
编译时出现Cannot open precompiled header file: 'Debug/11.pch': No such file or directory的错误提示 展开
void CMy11Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
CFile file;
CString str;
GetDlgItemText(IDC_EDIT,str);
file.Open("1.doc",CFile::modeWrite|CFile::modeCreate);
file.Write(str,str.GetLength());
file.Close();
}
GetDlgItemText
void CMy11Dlg::OnButton2()
{
// TODO: Add your control notification handler code here
CFile file;
char str[1000]={"\0"};
file.Open("1.doc",CFile::modeRead);
file.Read(str,file.GetLength());
file.Close();
SetDlgItemText(IDC_EDIT,str);
}
编译时出现Cannot open precompiled header file: 'Debug/11.pch': No such file or directory的错误提示 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询