title: CFile returns debug assertion
body: <p>I have an old project in Visual C++ and I'm trying to migrate it to Visual Studio 2013. When I verify if a txt file exists, <code>CFile</code> returns debug assertion error. The code is: </p>
  
  <pre><code>if (!txt_file.Open(txt_name,    CFile::modeWrite | CFile::shareDenyWrite  | CFile::typeText))
  {
      //action if the file exists
  }
  </code></pre>
  
  <p>What is the problem, I'm doing something wrong ?
  Thank you</p>
  
  <p>L.E. : </p>
  
  <p><code>txt_file</code> is declared as : <code>CStdioFile txt_file</code> in the class <code>trace</code> <br>
  <code>txt_name</code> is declared as : <code>private CString txt_name</code> in the method named <code>open_file</code> from class <code>trace</code>  <br>
  The method <code>open_file</code> contains the if statement that returns debug assertion error. </p>