应用程序仅在 64 位版本上出错 [英] Application gives error only on 64 bit version

查看:28
本文介绍了应用程序仅在 64 位版本上出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果是 32 位版本,我的应用程序运行良好,但是当我将新的 64 位平台添加到配置管理器并尝试运行它时,我在启动时收到以下消息:

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:

推荐答案

阅读后 64位问题清单问题/a> 我总结出问题是清单行

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='*'"")

注意 processorArchitecture 值的不同.

现在一切正常!

这篇关于应用程序仅在 64 位版本上出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆