title: SHGetFolderPath Deprecated: What is alternative to retrieve path for Windows folders?
body: <p>The <code>SHGetFolderPath()</code> function is deprecated beginning with Windows Vista: <a href="http://msdn.microsoft.com/en-us/library/bb762181%28v=VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb762181%28v=VS.85%29.aspx</a></p>
  
  <p>What is the alternative way to retrieve the path to the Application Folder in Windows?</p>
  
  <pre><code>SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPath)
  </code></pre>
  
  <p>Aside from that, why do I get those errors when using this function:</p>
  
  <pre><code>Error   1   error C2065: 'CSIDL_COMMON_APPDATA' : undeclared identifier 
  
  Error   2   error C3861: 'SHGetFolderPath': identifier not found
  </code></pre>