在 VB6 应用程序中使用 ImageList 会导致 Windows 7.0 64 位崩溃

发布于 2024-07-25 04:53:10 字数 283 浏览 10 评论 0原文

我有一个旧的 VB6 应用程序,它使用 COMCTL32.OCX(“Microsoft Windows Common Controls 5.0 (SP2)”)中的 ImageList 控件来提供 TreeView 和 ListView 的图标。

该应用程序甚至无法在 Windows 7.0 64 位上启动。 当它尝试加载包含 ImageList 的表单时,它就会崩溃(好吧,实际上,应用程序眨眼退出,不留痕迹地退出)。

从表单中删除 ImageList 可以解决该问题。

有任何想法吗?

I have an old VB6 application that uses an ImageList control from COMCTL32.OCX ("Microsoft Windows Common Controls 5.0 (SP2)") to provide icons for TreeViews and ListViews.

The app won't even launch on Windows 7.0 64 bit. The minute it tries to load the form that has the ImageList on it, it crashes (well, actually, the app winks out, exiting without a trace).

Removing the ImageList from the form solves the problem.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

诠释孤独 2024-08-01 04:53:11

我通过将 VB5 附带的 COMCTL32.OCX 的所有实例替换为 VB6 附带的 MSCOMCTL.OCX 解决了这个问题。

Microsoft 知识库文章 190952 提供了执行此操作的说明。 这几乎只是一个全局搜索和替换操作。

I resolved this problem by replacing all instances of COMCTL32.OCX, which came with VB5, with MSCOMCTL.OCX, which came with VB6.

Microsoft KB article 190952 has instructions for doing this. It was pretty much just a global-search-and-replace operation.

<逆流佳人身旁 2024-08-01 04:53:11

向 Microsoft 报告错误。 VB6 运行时在 64 位 Windows 7 上仍然受支持。 COMCTL32 .ocx 未随 Windows 7 一起安装,但明确列出 Windows 7 支持。

Report a bug to Microsoft. The VB6 runtime is still supported on 64-bit Windows 7. COMCTL32.ocx isn't installed with Windows 7, but it is explicitly listed as supported on Windows 7.

妖妓 2024-08-01 04:53:11

你的解决方案没问题。
但无论如何,COMCTL32.OCX 在 Win64(Vista 或 7)上应该可以正常工作。

只是一点建议:

如果使用 MSCOMCTL.OCX,您将无法将 XP/Vista/7 样式应用于列表视图或树视图,并且您的应用程序可能看起来很陌生。 清单不会对 MSCOMCTL.OCX 控件产生任何影响。

解决方法是对 MSCOMCTL.OCX 控件进行子类化,并且由于它们仍然包含 COMCTL32.DLL 标头,因此您可以操纵它的绘制方式。

(我本来想发表评论,但我还是不能)

Your solution is OK.
But COMCTL32.OCX should work fine on Win64 anyway (Vista or 7).

Just a little advice:

If using MSCOMCTL.OCX you won't be able to apply to your listview or treeview the XP/Vista/7 style and your app might look alien. Manifest won't have any effect on MSCOMCTL.OCX controls.

A workaround would be to subclass the MSCOMCTL.OCX controls, and since they still contain a COMCTL32.DLL header you could manipulate how it paints.

(I would've posted as a comment, but I still can't)

世俗缘 2024-08-01 04:53:11

您可能遇到数据执行保护 (DEP) 问题。 通过禁用 DEP 进行测试:

bcdedit.exe /set {current} nx AlwaysOff

在命令行中输入上述内容后重新启动。 请记住将其重新打开,因为这相当于脱下裤子运行 Windows。

编辑:上面的命令适用于 Vista。 我还没有在 Windows 7 上尝试过。

It's possible you're running into an issue with Data Execution Protection (DEP). Test it out by disabling DEP:

bcdedit.exe /set {current} nx AlwaysOff

Reboot after entering the above in a command line. Remember to turn it back on as it's the equivalent of running Windows with your pants down.

Edit: The command above works on Vista. I haven't tried it on Windows 7.

独木成林 2024-08-01 04:53:11

一个不太剧烈的 DEP 调整是进入计算机性能对话框(系统属性的高级选项卡)并将应用程序 exe 添加到 DEP 选项卡上的例外列表中。

顺便说一句,您确定这不属于 serverfault.com 吗? :P

A less drastic DEP tweak is go into the computers performance dialog (advanced tab of system properties) and add the apps exe to the list of exceptions on the DEP tab.

BTW, are you sure this doesn't belong on serverfault.com. :P

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文