title: Using Windows API File functions c++
body: <p>New to windows programming, there are several examples all over the internet of what i am about to ask however none of them show the comparison which i think is failing.</p>
  
  <p>I'm using several windows api calls throughout my C++ Program and just need some guidence on how to use them correctly.</p>
  
  <p>For example below i have GetFileAttributes() which returns anything from File Attribute Constants.</p>
  
  <pre><code>DWORD dwAttributes = GetFileAttributes(strPathOfFile.c_str());
  if ( dwAttributes != 0xffffffff )
  {
      if ( dwAttributes == FILE_ATTRIBUTE_NORMAL )
      {
          pkFileInfoList-&gt;Add( strPathOfFile + "\t" +"FILE_ATTRIBUTE_NORMAL");
      }
      else if ( dwAttributes == FILE_ATTRIBUTE_ARCHIVE )
      {
          pkFileInfoList-&gt;Add( strPathOfFile + "\t" + "FILE_ATTRIBUTE_ARCHIVE");
      }
  }
  </code></pre>
  
  <p>[/CODE]</p>
  
  <p>The if/else statement continues with everything from File Attribute Constants.</p>
  
  <p>Am i using this correctly, i have a directory with over 2500 files which i am feeding the path recusivly. It is always returning FILE_ATTRIBUTE_ARCHIVE.</p>
  
  <p>Thanks,</p>