title: How to enable common controls in a Windows app
body: <p>I'm trying to enable common controls in an application. I followed the steps given in <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx" rel="noreferrer">this MSDN article</a>, specifically the section <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx#no_extensions" rel="noreferrer">Using ComCtl32.dll Version 6 in an Application That Uses Only Standard Extensions</a>. But I can't get it to work.</p>
  
  <p>The only thing I'm doing differently from the article is that I add the manifest information in <strong>Project Property Pages | Configuration Properties | Linker | Manifest File | Additional Manifest Dependencies</strong>. This is what I enter in the textbox:</p>
  
  <p><em>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*' xmlns='<a href="http://schemas.microsoft.com/developer/msbuild/2003" rel="noreferrer">http://schemas.microsoft.com/developer/msbuild/2003</a>'";%(AdditionalManifestDependencies)</em></p>
  
  <p>When I check the generated manifest (MyApp.exe.intermediate.manifest), it looks correct.</p>
  
  <p>I also add a link dependency to ComCtl32.lib in <strong>Project Properties | Configuration Properties | Linker | Input | Additional Dependencies</strong>. I also call InitCommonControlsEx at startup with the INITCOMMONCONTROLSEX structure initialized like this:</p>
  
  <pre><code>INITCOMMONCONTROLSEX icex;
  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icex.dwICC = ICC_STANDARD_CLASSES;
  </code></pre>
  
  <p>But the call to InitCommonControlsEx always returns FALSE (which means it failed). After some investigation I found out that the error code returned from GetLastError is ERROR_FILE_NOT_FOUND. What could be the problem?</p>
  
  <p><strong>UPDATE:</strong> I noticed something that could be related to the "file not found error". When I run the app from the debugger, one of the lines in the Output window is:</p>
  
  <blockquote>
    <p>'MyApp.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6002.18305_none_88f3a38569c2c436\comctl32.dll', Cannot find or open the PDB file</p>
  </blockquote>
  
  <p>However, there are a bunch of similar lines for some of the more standard libraries like kernel32.lib, user32.lib, etc:</p>
  
  <blockquote>
    <p>'MyApp.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file</p>
    
    <p>'MyApp.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file</p>
    
    <p>'MyApp.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file</p>
    
    <p>'MyApp.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file</p>
  </blockquote>
  
  <p>Those lines always appear for any application, and it causes no problems. Could it be different for ComCtl32.dll?</p>