Dialog border different after porting code from Visual Studio 6 to Visual Studio 2013(将代码从 Visual Studio 6 移植到 Visual Studio 2013 后对话框边框不同)
问题描述
我刚刚将一个基于对话框的 MFC 程序从 Visual Studio 6 移植到 Visual Studio 2013.没有重大问题,程序在 VS 2013 下编译后运行完美.
I have just ported a dialog based MFC program from Visual Studio 6 to to Visual Studio 2013. There were no major issues and the program runs perfectly once compiled under VS 2013.
唯一可见的区别是对话框边框的粗细(参见下面在 Windows 7 下制作的屏幕截图).
The only visible difference is the thickness of the dialog's borders (see screen shots below made under Windows 7).
更多事实:
- 这不是清单问题,新旧版本的清单完全相同.
- .rc 在 VS2012 项目转换过程中没有被弄乱.如果我用 VS6 再次编译转换后的项目,我会得到细边框.
- 我可以在 Visual Studio 6 中使用新生成的向导程序重现该问题.
- 使用
AfxMessageBox显示的消息框在使用 VS6 编译时也具有细边框,在编译时具有粗边框使用 VS2013.
- It's not a manifest issue, both manifests in the old and new versions are strictly the same.
- The .rc hasn't been messed up during the conversion of the project by VS2012. If I compile the converted project again with VS6 I get thin borders.
- I can reproduce the issue with a freshly wizard generated program in Visual Studio 6.
- A message box shown with
AfxMessageBoxalso has a thin border when compiled with VS6 and a thick border when compiled with VS2013.
推荐答案
我也遇到过类似的问题,和PE header的subsystem flag有关.
I have experienced similar issue and it was related with subsystem flag of PE header.
我需要稍微调试 Windows 才能找到原因:函数 win32k!_GetWindowBorders 根据 6.0 检查 PE 标志(可能是为了支持新标志 SM_CXPADDEDBORDER).
I needed to debug Windows a bit to find the reason: the function win32k!_GetWindowBorders checks that PE flag against 6.0 (probably to support new flag SM_CXPADDEDBORDER).
另见:
- 回归:::GetSystemMetrics 提供不同的值
这篇关于将代码从 Visual Studio 6 移植到 Visual Studio 2013 后对话框边框不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将代码从 Visual Studio 6 移植到 Visual Studio 2013 后对话框边框不同
基础教程推荐
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
