简体   繁体   English

TImageList在Win7上读取错误(ComCtl32问题?)-如何/为什么发生?

[英]TImageList read error on Win7 (ComCtl32 issue?) - how/why can it happen?

I needs ideas on how to track-down / solve this problem: 我需要有关如何跟踪/解决此问题的想法:

I have a potential customer who states that on Windows 7 32bit my software is giving this error: 我有一个潜在客户,该客户指出在Windows 7 32bit上我的软件出现此错误:

imagelist Failed to read ImageList data from stream imagelist无法从流中读取ImageList数据

Person has given this additional information: 人员已提供此附加信息:

  • Program does work with Areo theme enabled 程序确实启用了Areo主题
  • Program throws the error on classic theme 程序在经典主题上抛出错误
  • IE 11 is installed IE 11已安装
  • Person reports having both 5.82.7601.18837 comctl32.dll in system32 folder and 6.10.7601.23039 comctl32.dll in winsxs folder 人员报告在system32文件夹中同时具有5.82.7601.18837 comctl32.dll和在winsxs文件夹中均具有6.10.7601.23039 comctl32.dll

(Quick note for those who not aware - since WinXP both versions have shipped as default) (对于那些不知道的人的快速说明-自WinXP以来,两个版本均已默认提供)

... ...

The executable is built using XE4 on a themed Windows 10 and works on at least (own tested) 该可执行文件是在主题Windows 10上使用XE4构建的,并且至少可以在(经过自己测试)上使用

  • win10/32bit Win10 / 32位
  • win10/64bit Win10 / 64位
  • WinXP/32bit/classic-theme WinXP / 32bit /经典主题
  • HyperV-Virtual-Win7-SP1/32bit/classic-theme/16bitcolor HyperV-Virtual-Win7-SP1 / 32bit /经典主题/ 16bitcolor

My TImagelist is set to "cdDeviceDependent" (which corresponds to ILC_COLORDDB) 我的TImagelist设置为“ cdDeviceDependent”(对应于ILC_COLORDDB)

... ...

This is my manifest extracted from my executable using a resource explorer: 这是我使用资源浏览器从可执行文件中提取的清单

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        publicKeyToken="6595b64144ccf1df"
        language="*"
        processorArchitecture="*"
      />
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="asInvoker"
          uiAccess="false"
        />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
    </application>
  </compatibility>
</assembly>

... ...

TODO 去做

I have noticed in documentation that for ImageList_WriteEx is states: "You should not create an image list that is written with the ILP_DOWNLEVEL flag with ILC_COLOR32" ... 我已经在文档中注意到ImageList_WriteEx的状态是: “您不应创建使用ILP_DOWNLEVEL标志和ILC_COLOR32编写的图像列表”

I am not sure what happens when compiling on a 32bit-color system using "ILC_COLORDDB" as value? 我不确定在使用“ ILC_COLORDDB”作为值的32位彩色系统上进行编译时会发生什么情况?

My thinking is/was that ILP_DOWNLEVEL would possible be ignore... And thus more likely to fail when read by 5.x ComCtl32 ? 我的想法是/是否有可能会忽略ILP_DOWNLEVEL ...因此当被5.x ComCtl32读取时更有可能失败? But I have not been able to find any such cases described on the internet, but... 但是我无法在互联网上找到任何此类案例,但是...

Also it appears my executable works on a virtual Win7-SP1-32bit-16color-classic-themes configuration... 似乎我的可执行文件也可以在虚拟Win7-SP1-32bit-16color-classic-themes配置下工作...

... ...

TODO 去做

Send a debug tool to fetch/confirm the actual version loaded on comctl32.dll 发送调试工具以获取/确认comctl32.dll上加载的实际版本

... ...

TRIED 试过

I have tried pointing the user to an old version with a manifest without the **compability section. 我尝试将用户指向带有清单的旧版本,而该清单没有** compability部分。 That did not make any difference. 那没有任何区别。

By default the ComCtl32 version on Windows 7 is 5.82 and not 6.x. 默认情况下,Windows 7上的ComCtl32版本是5.82,而不是6.x。

Common Control Versions 通用控制版本

So you will have to modiffy your manifest acordingly to allow use Comctl32 version compatible with Windows 7. 因此,您将不得不相应地更改清单以允许使用与Windows 7兼容的Comctl32版本。

That is of course if your application isn't using some feature that isn't present in ComCtl32 version 5.82. 当然,如果您的应用程序未使用ComCtl32 5.82版中不提供的某些功能。 If it does then you will have to implement some workarround to it or simply remove Windows 7 from officially supported platforms for your application. 如果确实如此,则您将不得不对其进行一些解决,或者只是从应用程序的官方支持平台中删除Windows 7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM