I'm trying to enable common controls in an application. I followed the steps given in this MSDN article, specifically the section Using ComCtl32.dll Version 6 in an Application That Uses Only Standard Extensions. But I can't get it to work.
The only thing I'm doing differently from the article is that I add the manifest information in Project Property Pages | Configuration Properties | Linker | Manifest File | Additional Manifest Dependencies. This is what I enter in the textbox:
"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'";%(AdditionalManifestDependencies)
When I check the generated manifest (MyApp.exe.intermediate.manifest), it looks correct.
I also add a link dependency to ComCtl32.lib in Project Properties | Configuration Properties | Linker | Input | Additional Dependencies. I also call InitCommonControlsEx at startup with the INITCOMMONCONTROLSEX structure initialized like this:
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_STANDARD_CLASSES;
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?
UPDATE: 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:
'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
However, there are a bunch of similar lines for some of the more standard libraries like kernel32.lib, user32.lib, etc:
'MyApp.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'MyApp.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'MyApp.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'MyApp.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
Those lines always appear for any application, and it causes no problems. Could it be different for ComCtl32.dll?