title: how to get path text from CMFCEditBrowseCtrl?
body: <p>I'm working on MFC win32 project. I have dialog with 2 CMFCEditBrowseCtrl controls. After user specifies files on these controls, how to get file paths from these controls?</p>
  
  <p><strong>Update:</strong> here is my code  </p>
  
  <pre><code>SpecifyInputDialog dlg; // this is my dialog inherited from CDialogEx
  dlg.DoModal();
  CString strText;
  dlg.inFileCtrl.GetWindowTextA(strText.GetBuffer(), 500); // inFileCtrl is CMFCEditBrowseCtrl object
  </code></pre>
  
  <p>Results in "Debug Assertion Failed" error on last line...</p>
  
  <p><strong>Update 2:</strong></p>
  
  <pre><code>CString strText;
  dlg.inFileCtrl.GetWindowText(strText);
  </code></pre>
  
  <p>The same "Debug Assertion Failed" error. I will try to get text while dialog not dissmissed.</p>
  
  <p><strong>Update 3 (solved):</strong></p>
  
  <p>I managed to get path text by implementing callback</p>
  
  <pre><code>BEGIN_MESSAGE_MAP(SpecifyInputDialog, CDialogEx)
    ON_EN_CHANGE(IDC_MFCEDITBROWSE1, &amp;SpecifyInputDialog::OnEnChangeMfceditbrowse1)
  END_MESSAGE_MAP()  
  </code></pre>
  
  <p>And in handler method:</p>
  
  <pre><code>void SpecifyInputDialog::OnEnChangeMfceditbrowse1()
  {
      this-&gt;inFileCtrl.GetWindowText(this-&gt;inFileString);
  }
  </code></pre>
  
  <p>So your thought about getting text while dialog are not closed yet was right. Please update your answer thus I could mark it as solution.</p>