如何让旧的 VB6 应用程序在 Windows Vista 和 Windows 7 中运行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2615891/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:15:17  来源:igfitidea点击:

How to keep an old VB6 application running in Windows Vista and Windows 7?

windowsvb6dependencies

提问by MusiGenesis

I have an old VB6 app which I'm still trying to support. A few users have reported weird crashes when running the app in Vista or Windows 7. The log files don't show anything after one of these crashes, but the customers report that the error message said "OLE something ...", if they saw anything at all.

我有一个旧的 VB6 应用程序,我仍在努力支持它。一些用户在 Vista 或 Windows 7 中运行该应用程序时报告了奇怪的崩溃。在这些崩溃之一后,日志文件不显示任何内容,但客户报告错误消息说“OLE 东西...”,如果他们什么都看到了。

I've never been able to reproduce these crashes while running the program on my own Vista or Windows 7 boxes, so I have essentially no information on what the problem is.

在我自己的 Vista 或 Windows 7 机器上运行程序时,我从来没有能够重现这些崩溃,所以我基本上没有关于问题所在的信息。

My suspicion is that it's a problem with their versions of one or more of the umpteen billion DLLs that a VB6 application is dependent on. The app also uses lame_enc.dll, which introduces a few more dependencies.

我怀疑是他们的 VB6 应用程序所依赖的无数 DLL 中的一个或多个版本存在问题。该应用程序还使用 lame_enc.dll,它引入了更多依赖项。

I'm guessing this is a common problem with VB6 apps (although it's possible that I just sucked as a programmer 10 years ago). Is there some magical installer/updater out there that makes sure all the VB6 dependencies are what they need to be for a VB6 app to function properly?

我猜这是 VB6 应用程序的一个常见问题(尽管 10 年前我可能只是作为一个程序员很糟糕)。是否有一些神奇的安装程序/更新程序可以确保所有 VB6 依赖项都是 VB6 应用程序正常运行所需的内容?

采纳答案by MarkJ

One option is to contact Microsoft technical support. The VB6 runtime is fully supportedon Windows 7. You may need to pay for a "support incident": or it may be free, for instance if you have an MSDN subscription (good idea to get one).

一种选择是联系 Microsoft 技术支持。Windows 7完全支持VB6 运行时。您可能需要为“支持事件”付费:或者它可能是免费的,例如,如果您订阅了 MSDN(订阅是个好主意)。

回答by dkackman

If Compatibility Modedoesn't work there is also XP Mode. This virtualizes the entire environment in an XP virtual machine but also allows it to interact with the host OS. It's only available for Windows 7 though.

如果Compatibility Mode不起作用,还有XP Mode。这将虚拟化 XP 虚拟机中的整个环境,但也允许它与主机操作系统交互。不过,它仅适用于 Windows 7。

回答by Chris Thornton

Have the user run the app in compatibility mode for XP. Just drag a shortcut onto the desktop, right-click, Properties. Then on the Compatibility tab, set it to "run in compatibility mode for:" and pick "Windows XP (Service Pack 3)". And also "disable display scaling on high DPI settings". See if that helps. It just might.

让用户在 XP 兼容模式下运行应用程序。只需将快捷方式拖到桌面上,右键单击,属性。然后在兼容性选项卡上,将其设置为“以兼容模式运行:”并选择“Windows XP (Service Pack 3)”。还有“在高 DPI 设置下禁用显示缩放”。看看是否有帮助。它只是可能。

回答by CJ7

Try a third party installer like Installshield. I have a VB6 app which didn't install and run properly on Win 7 using the original installer, but I when I put it through a recent version of Installshield it now works fine.

尝试像 Installshield 这样的第三方安装程序。我有一个 VB6 应用程序,它没有使用原始安装程序在 Win 7 上正确安装和运行,但是当我通过最新版本的 Installshield 安装它时,它现在可以正常工作。

回答by Mike Spross

We've had just generally odd behavior with some customers who have tried to run our application on Windows 7. In one case, the application's main toolbar (a standard MSComctlLib.Toolbarcontrol) was completely empty (none of the icons or separator bars appeared). We were mystified. The program didn't crash, the icons just simply weren't there. Nothing in the application's error logs, nothing in the Windows event log. We even made sure the application was configured to run in Windows XP Compatibility Mode, but no dice. As far as we knew, the correct DLL's were installed and registered, and we have run the same application on the same version of Windows 7 since then without any problems.

对于一些试图在 Windows 7 上运行我们的应用程序的客户,我们遇到了一些奇怪的行为。在一种情况下,应用程序的主工具栏(一个标准MSComctlLib.Toolbar控件)完全是空的(没有任何图标或分隔条出现)。我们很困惑。程序没有崩溃,只是图标不存在。应用程序的错误日志中没有任何内容,Windows 事件日志中也没有。我们甚至确保应用程序配置为在 Windows XP 兼容模式下运行,但没有骰子。据我们所知,正确的 DLL 已安装和注册,并且从那时起我们在相同版本的 Windows 7 上运行相同的应用程序,没有任何问题。

In a somewhat ironic decision, not long before that we had decided to officially support Windows 7, while at the same time stating we wouldn't officially support Vista (although some customers are running the application on Vista without any issues). At first, this might sound like an odd decision, but there are two good reasons why this makes sense:

有点讽刺的是,不久之前我们决定正式支持 Windows 7,同时声明我们不会正式支持 Vista(尽管有些客户在 Vista 上运行该应用程序没有任何问题)。乍一看,这听起来像是一个奇怪的决定,但有两个很好的理由说明这样做很有意义:

  • Most new computers will have Windows 7 pre-installed, and most customers who skipped upgrading to Vista due to all the FUD surrounding it are very interested in upgrading from XP to Windows 7.

  • Windows 7 supports XP Mode, which lets you run apps in a virtual machine that is running Windows XP SP3. Some of our customers have gone this route and none have reported any problems running our application this way. Because you are running your application in an actual Windows XP environment, there is much less chance for things to go wrong.

  • 大多数新电脑都预装了 Windows 7,大多数因为周围的 FUD 而跳过升级到 Vista 的客户对从 XP 升级到 Windows 7 非常感兴趣。

  • Windows 7 支持XP Mode,它允许您在运行 Windows XP SP3 的虚拟机中运行应用程序。我们的一些客户已经走了这条路,没有人报告以这种方式运行我们的应用程序有任何问题。因为您在实际的 Windows XP 环境中运行您的应用程序,所以出错的可能性要小得多。

回答by jasonk

I'll vote the XPMode as well.

我也会投票给 XPMode。

However, if you still have issues, Dependency Walker is a good free tool that scans an exe/dll/ocx and builds a tree diagram of all dependent modules/dlls. Even without this issue it's helpful in troubleshooting install issues.

但是,如果您仍然有问题,Dependency Walker 是一个很好的免费工具,它可以扫描 exe/dll/ocx 并构建所有依赖模块/dll 的树状图。即使没有这个问题,它也有助于解决安装问题。

http://www.dependencywalker.com/

http://www.dependencywalker.com/

Additionally, we had several issues in the past with items that write the registry where the user didn't have proper security rights that caused similar issues. You might check code those functions if you have them.

此外,我们过去在写入注册表的项目中遇到了几个问题,而用户没有适当的安全权限会导致类似的问题。如果你有这些函数,你可以检查它们的代码。