简体   繁体   中英

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. Some of these issues go away if we set the Compatibility Mode of the application to 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. Maybe using Compatibility Mode while we replace the VB6 isn't a bad thing.

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).

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).

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.

I have an old vb6 app that I recently had to make work on win7 64 bit. Running in xp mode was part of the solution. I had other problems with the old installer and needed to run regsvr32.exe against windows\\sysWOW64\\ with an elevated command prompt. 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. Hope that helps. cheers Dave

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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