FileOpen Problem
-
Hello. Im trying to open a file to read some data using VC6 MFC. The problem is that I dont know how to go about after getting the pathname.
void CMyExtractDataDlg::OnFileOpen() { // TODO: Add your control notification handler code here /////////////////////// // MY CODE STARTS HERE /////////////////////// CFileDialog m_ldFile(TRUE); // Show the File open dialog and capture the result if (m_ldFile.DoModal() == IDOK) { // Get the pathname selected m_filePath = m_ldFile.GetPathName(); // Update the dialog UpdateData(FALSE); } /////////////////////// // MY CODE ENDS HERE /////////////////////// }
Should I get the filename as well or is pathname alone sufficient? How do i go from here? Thanks in advance. -
Hello. Im trying to open a file to read some data using VC6 MFC. The problem is that I dont know how to go about after getting the pathname.
void CMyExtractDataDlg::OnFileOpen() { // TODO: Add your control notification handler code here /////////////////////// // MY CODE STARTS HERE /////////////////////// CFileDialog m_ldFile(TRUE); // Show the File open dialog and capture the result if (m_ldFile.DoModal() == IDOK) { // Get the pathname selected m_filePath = m_ldFile.GetPathName(); // Update the dialog UpdateData(FALSE); } /////////////////////// // MY CODE ENDS HERE /////////////////////// }
Should I get the filename as well or is pathname alone sufficient? How do i go from here? Thanks in advance. -
Hello. Im trying to open a file to read some data using VC6 MFC. The problem is that I dont know how to go about after getting the pathname.
void CMyExtractDataDlg::OnFileOpen() { // TODO: Add your control notification handler code here /////////////////////// // MY CODE STARTS HERE /////////////////////// CFileDialog m_ldFile(TRUE); // Show the File open dialog and capture the result if (m_ldFile.DoModal() == IDOK) { // Get the pathname selected m_filePath = m_ldFile.GetPathName(); // Update the dialog UpdateData(FALSE); } /////////////////////// // MY CODE ENDS HERE /////////////////////// }
Should I get the filename as well or is pathname alone sufficient? How do i go from here? Thanks in advance.Use can use CStdioFile for file operations
Known is a drop, unknown is an ocean
-
Hello. Im trying to open a file to read some data using VC6 MFC. The problem is that I dont know how to go about after getting the pathname.
void CMyExtractDataDlg::OnFileOpen() { // TODO: Add your control notification handler code here /////////////////////// // MY CODE STARTS HERE /////////////////////// CFileDialog m_ldFile(TRUE); // Show the File open dialog and capture the result if (m_ldFile.DoModal() == IDOK) { // Get the pathname selected m_filePath = m_ldFile.GetPathName(); // Update the dialog UpdateData(FALSE); } /////////////////////// // MY CODE ENDS HERE /////////////////////// }
Should I get the filename as well or is pathname alone sufficient? How do i go from here? Thanks in advance.ReturnRain wrote:
The problem is that I dont know how to go about after getting the pathname.
Once you have a file name then call yout Application class's OpenDocumentFile(m_filePath); i.e. theApp.OpenDocumentFile(m_filePath); I think this will serve the purpose.
Sameer Thakur