calling TaskDialogIndirect loader says ordinal 345 not found

此生再无相见时 提交于 2019-12-02 13:18:34

问题


I built the simple MS example for TaskDialogIndirect (see https://msdn.microsoft.com/en-us/library/windows/desktop/bb760544(v=vs.85).aspx)

When I run it I get "The ordinal 345 could not be located in the dynamic link library COMCTL32.dll"

The above page says it needs ComCtl32.DLL version 6 but C:\Windows\System32\ComCtl32.DLL is 5.82.7601.18201 and I can't find a version 6 anywhere on the disk.

I am running Windows 7 with VS2012. TaskDialog was added in Vista so why don't I have the correct version of ComCtl32.DLL???


回答1:


Here's a common and useful block of code that should help to load the correct common controls, comctl32.dll:

#if defined _M_IX86
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif



回答2:


There are two versions of ComCtl32.dll on Windows XP and later (SxS). v5.8x is the default, you need to opt-in to get v6 because of possible incompatibility's with the new Themes/Visual Styles. Most new features and controls have only been added to v6.

To get v6 you must add a manifest to your application. It is recommended that you embed the manifest in the applications resources but you can also use a external manifest; just name the XML file yourappname.exe.manifest.




回答3:


You can run sfc /scannow to resolve this issue. [Reference].



来源:https://stackoverflow.com/questions/37016803/calling-taskdialogindirect-loader-says-ordinal-345-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!