读INI文件内容void CINI_File_TestDlg::OnButtonRead()
{
// TODO: Add your control notification handler code here
CString strSection = "Section1";
CString strSectionKey = "Item1";
char strBuff[256];
CString strValue = _T("");
CString strFilePath;
strFilePath=GetCurrentDirectory(256,strBuff); //获取当前路径
strFilePath.Format("%s\\Test.ini",strBuff);
GetPrivateProfileString(strSection,strSectionKey,NULL,strBuff,80,strFilePath); //读取ini文件中相应字段的内容
strValue=strBuff;
SetDlgItemText(IDC_EDIT_NAME,strValue);
strSectionKey="Item2";
GetPrivateProfileString(strSection,strSectionKey,NULL,strBuff,80,strFilePath);
strValue=strBuff;
SetDlgItemText(IDC_EDIT_PASSWORD,strValue);
UpdateData(FALSE);
}
CString strValue = _T("");这个_T("")是什么意思?
UpdateData(FALSE); 这个函数什么作用,改成TRUE会怎样?
另外,这个CString这个类型谁能讲解下,以前学C或c++没用过。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货