【发布时间】:2011-09-14 14:05:09
【问题描述】:
我使用纯 win32 api(没有 MFC 或 WPF)用 C++ 编写了一个应用程序。 我希望相同的 .exe 在 Window 的 XP 和 Windows Vista / Windows 7 下运行。
我正在使用清单将视觉样式添加到我的应用程序中的控件。但是,当我在 XP 机器上测试应用程序时,按钮不显示。只有编辑控件和菜单栏可以。
编辑:我想我忘了提及这一点,但该应用程序在 WIndows 7/Vista 上运行良好。 编辑 2: 我正在使用 MinGW 编译器 我认为这是清单的问题,所以我将其删除并重新编译了我的程序。但是按钮仍然没有出现。 我使用的清单如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="BlackJack.Viraj"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.2600.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
问题出在清单中还是其他原因?
【问题讨论】:
-
您是否使用了带有 UAC 盾牌的新按钮样式?我不知道 XP 是否忽略了未知标志,或者它是否是一个未知按钮。
-
没有。它们都是普通的按钮。
-
能贴出按钮创建的代码吗?
-
问题在于没有调用 InitCommonControls。
标签: c++ windows winapi manifest