C++对话框资源

源代码在线查看: recite.txt

软件大小: 2 K
上传用户: hqbbsw
关键词: 对话框 资源
下载地址: 免注册下载 普通下载 VIP

相关代码

				CFileDialog  FileDlg(TRUE, "*.txt", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "(*.txt)|*.txt||");
					FileDlg.DoModal();
					CString  cstrFileName;
					cstrFileName = FileDlg.GetPathName();
					//未选中任何文件
					if ("" == cstrFileName)
					{
						return ;
					}
					CFile    file;
					char*    pszBuff = NULL;
					if (file.Open(cstrFileName.GetString(), CFile::modeReadWrite | CFile::shareDenyWrite))
					{
						ULONGLONG   ullLeng = 0;
						ullLeng = file.GetLength();
						pszBuff = new char[ullLeng];//分配内存资源
						ZeroMemory(pszBuff, ullLeng);
						file.Read(pszBuff, ullLeng);
						file.Close();
					}
					//写入编辑框
					m_edtText.SetWindowText(pszBuff);
				
					//释放内存资源
					if (NULL != pszBuff)
					{
						delete [] pszBuff;
				
					}			

相关资源