从VS2010升级到VS2013已经破坏了我的MFC / ActiveX控件样式 [英] Upgrading from VS2010 to VS2013 has killed my MFC/ActiveX control styles

查看:197
本文介绍了从VS2010升级到VS2013已经破坏了我的MFC / ActiveX控件样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是一个.NET应用程序(WPF和WinForms),它通过ActiveX调用C ++项目。我们使用C ++,vC ++和MFC的混合物

My application is a .NET app (WPF and WinForms) which calls C++ projects via ActiveX. We use a mixture of C++, vC++ and MFC

最近我们从VS2010升级到了VS2013。

Recently we upgraded from VS2010 to VS2013.

我们有3个项目使用MFC对话框。自升级到VS2013 pack 5(具有Multi Byte支持)以来,我们注意到每个带有MFC对话框的项目都会呈现它们没有任何样式

We have 3 projects which uses MFC dialogs. Since upgrading to VS2013 pack 5 (with Multi Byte support) we've noticed that every project with MFC dialogs renders them without any styles

在每个项目的stdafx.h文件中,我们有(注意,没有ifdef围绕)

In each project's stdafx.h file, we have (note, no ifdef surrounding)

#pragma

comment (链接器, " / manifestdependency:\" type ='win32'
name ='Microso ft.Windows.Common-Controls'version ='6.0.0.0'processorArchitecture ='*'publicKeyToken ='6595b64144ccf1df'language ='*'\""

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

如果我打开链接器的属性页 - >清单文件,我可以看到Allow Isloation设置为true。

If I open the Property Pages for Linker -> Manifest File, I can see that Allow Isloation is set to true.

如果我向解决方案添加一个新的MFC项目并直接调试该项目,视觉样式将按预期呈现  :s

If I add a new MFC project to the solution and debug that project directly, visual styles are rendered as expected :s

我还能做些什么来尝试解决这个问题? 

What else can I do to try to fix this? 

推荐答案

您好DaveRock,

Hi DaveRock,

感谢您在此发布。

>>我们有3个项目它使用MFC对话框。自升级到VS2013 pack 5(具有Multi Byte支持)以来,我们注意到每个带有MFC对话框的项目都会呈现它们没有任何样式

您是否重建了c ++项目?另请查看
InitCommonControls
  ;在你的CWinApp :: iniInitInstance方法中,如果它正常工作?如果你正在使用多字节,你需要下载
Visual Studio 2013的多字节MFC库

Have you rebuild your c++ project? Also check the InitCommonControls in your CWinApp::iniInitInstance method if it works correctly? If you're using multi byte, you need to download Multibyte MFC Library for Visual Studio 2013 too.

请 检查项目的构建选项以确保启用了清单生成。将yoru c ++项目与您从vs2013创建的MFC项目进行比较,以检查项目设置,尤其是Linker>清单文件和清单
工具>所有设置。此外,请确保清单始终作为资源嵌入,而不是作为单独的文件部署。 由链接器完成。您添加的#pragmas只能在链接器嵌入清单时才能工作。

Please  check your project's build options to ensure that manifest generation is enabled. Compare yoru c++ project with the MFC project you created from vs2013, to check the project settings, especially Linker > Manifest File and Manifest Tool > all settings. Also make sure the manifest should always be embedded as a resource, not deployed as a separate file.  Done by the linker. The #pragmas you added can only work when the linker embeds the manifest.

以下是一些文档供您参考。

Here are some documents for you as references.

https://msdn.microsoft.com/en-us/library/windows /desktop/bb773175(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/hh298349(v=vs.85).aspx

希望这对你有帮助。

最好的问候,

Sera Yu

Best Regards,
Sera Yu


这篇关于从VS2010升级到VS2013已经破坏了我的MFC / ActiveX控件样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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