c++ - Windows 7基本主题上的MFC控件隐藏

标签 c++ windows-7 mfc themes

谁能告诉我为什么 MFC 应用程序无法在 Windows 7 基本主题中正确显示?

编辑:有没有人能猜出问题所在?

编辑:

  • 我使用的是 vs2008(创建此应用程序时使用了相同的版本)。
  • 这个特定的窗口是基于 DLL 的。为了创建那个 DLL,我在 Stdafx.h 中添加了这些

.

#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
  • 此问题仅出现在该窗口中。
  • 这个窗口基于 CDialog,在 OnInitDialog() 中我正在做这些,

.

CDialog::OnInitDialog();
AfxInitRichEdit();
// And Create three more child windows.
  • 这是它在基本主题中的显示方式。

enter image description here

但是,当我更改为 Windows Aero 主题时它运行良好。

enter image description here 应该怎么解决?

编辑:有人愿意吗?

最佳答案

  • 建议在 Application 类的 InitInstance 函数中初始化 richedit 控件。我不确定它能否与 OnInitDialog 一起正常工作。
  • 从项目设置中检查您的程序/DLL 是否为 UNICODE 代码。
  • 默认情况下,Visual Studio 2008 将为程序(EXE)生成 list 。
  • 仅当应用程序是 UNICODE 时才必须嵌入 list 。

请检查这个。

关于c++ - Windows 7基本主题上的MFC控件隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6256240/

相关文章:

python - 如何在 Windows 7 上安装支持 Python 的 GDB

c++ - 在具有相同参数和兼容返回值的 C++ 方法指针之间进行转换

c++ - 如何修复 'No match for operator[]' 错误 (c++)

c++ - 尝试在 Ubuntu 上使用 pthread 时出错

c++ - 为什么不在此范围内声明下一个或上一个?

windows-7 - 无法安装 Windows 7 小工具

delphi - 了解可等待计时器

c++ - 无法弄清楚如何更改 MFC 控件背景颜色

c++ - Visual Studio 无法识别我的网络摄像头激光测距仪代码的 MFC 库

c++ - 从 CPtrArray MFC 输入和检索信息