title: Opening a text in notepad in MFC
body: <p>Just as the title stated. How do I open a text in notepad in MFC?</p>
  
  <p>I used the <code>CFileDialog</code> to open up a "Save As" dialog box like so :</p>
  
  <pre><code>TCHAR szFilters[] = 
      _T ("Text files (*.txt)¦*.txt¦All files (*.*)¦*.*¦¦");
  
  CFileDialog dlg (FALSE, _T ("txt"), _T ("*.txt"),
      OFN_OVERWRITEPROMPT, szFilters);
  
  if (dlg.DoModal () == IDOK)
      m_strPathName = dlg.GetPathName();
  </code></pre>
  
  <p>After I have the path name in <code>m_strPathName</code>, is there anyway to directly open up the txt file that had been saved in a Notepad?</p>
  
  <p>I have another button <code>OnShowData</code> and this is the code inside.</p>
  
  <p><code>ShellExecute(NULL, _T("open"), m_strPathName, NULL, NULL, SW_SHOW);</code></p>
  
  <p>Is there any other method that I could do this??</p>
  
  <p><strong>PROBLEM SOLVED</strong></p>