简体   繁体   English

Windows兼容模式的陷阱

[英]Pitfalls of Windows Compatibility Mode

We have a VB6 application that we're in the process of moving from Windows XP to Windows 7 and we've run into several issues. 我们有一个VB6应用程序,我们正在从Windows XP迁移到Windows 7的过程中,遇到了一些问题。 Some of these issues go away if we set the Compatibility Mode of the application to Windows XP (Service Pack 3). 如果将应用程序的兼容模式设置为Windows XP(Service Pack 3),则其中的某些问题将消失。

I'm wondering if simply running our application in Compatibility Mode is a good solution or not. 我想知道仅在兼容模式下运行我们的应用程序是否是一个好的解决方案。 I've been doing some Googling and have not found anything that implies there is a down side to using Compatibility Mode. 我一直在做一些谷歌搜索,但没有发现任何暗示使用兼容模式的缺点。 But most people use it for applications that they aren't developing. 但是大多数人将其用于他们尚未开发的应用程序。

The long-term goal is to replace all of the VB6 code with C#, but that's going to take time. 长期目标是用C#替换所有VB6代码,但这将需要时间。 Maybe using Compatibility Mode while we replace the VB6 isn't a bad thing. 也许在我们更换VB6时使用兼容模式并不是一件坏事。

Has anyone had experience with developing an application and intentionally having it run in Compatibility Mode? 有没有人有过开发应用程序并有意使其以兼容模式运行的经验? My gut says it's a bad idea, but I cannot find any evidence against using it. 我的直觉说这是个坏主意,但我找不到反对使用它的任何证据。

There are consumer apps (really bad idea compat mode) and Line Of Business apps - you do what you need to do. 有消费者应用程序(真的是糟糕的主意兼容模式)和业务线应用程序-您需要做的事。 You control the environment. 您控制环境。

These are the specific things WinXPSP2 does (I don't have an SP3 option on Vista). 这些是WinXPSP2的特定功能(在Vista中我没有SP3选项)。

DirectXVersionLie
ElevateCreateProcess
EmulateSorting
EnableLegacyExceptionHandlinginOLE
FailObsoleteShellAPIs
GlobalMemoryStatus2GB
HandleBadPtr
HardwareAudioMixer
LoadLibraryCWD
NoGhost
RedirectMP3Codec
VirtualRegistry
WinXPSP2VersionLie

A good guess is your app needs to run elevated (# 2 on list above). 一个很好的猜测是您的应用需要提升运行(上面列表中的#2)。

BTW If starting a process it starts it normally and if (the end function that does it) createprocess fails with ElevationRequired it restarts it elevated. 顺便说一句,如果启动一个进程,它将正常启动它;如果(执行该函数的最终功能)createprocess失败并显示ElevationRequired,它将重新启动它的提升。

I have an old vb6 app that I recently had to make work on win7 64 bit. 我有一个旧的vb6应用程序,最近我不得不在win7 64位上工作。 Running in xp mode was part of the solution. 以xp模式运行是解决方案的一部分。 I had other problems with the old installer and needed to run regsvr32.exe against windows\\sysWOW64\\ with an elevated command prompt. 我的旧安装程序还有其他问题,需要使用提升的命令提示符针对Windows \\ sysWOW64 \\运行regsvr32.exe。 I needed to be logged in as an administrator also to install as just running the installer as an administrator didn't work. 我还需要以管理员身份登录才能进行安装,因为仅以管理员身份运行安装程序无法正常工作。 Took 45mins or so registering components but fine in the end. 花费了45分钟左右的时间来注册组件,但最后还是没问题。 Hope that helps. 希望能有所帮助。 cheers Dave 欢呼戴夫

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

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