Application gives error only on 64 bit version

依然范特西╮ 提交于 2019-12-13 03:46:05

问题


My application runs well if is the 32 bit version, but when I added the new 64 bit platform to the Configuration manager and tried to run it, I got the following message at startup:


回答1:


After reading 64bit manifest problem / side by side issue I concluded the problem was the manifest line

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")

So I add to branch it, conditioned by the platform:

#ifdef _WIN64
#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='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif

So, I add to turn it generic, independent of the platform:

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

Notice the difference in processorArchitecture value.

Now everything is working fine!



来源:https://stackoverflow.com/questions/43119204/application-gives-error-only-on-64-bit-version

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