.dll 只能在 Windows XP 和 Vista 上正常工作,但不能在 7 上正常工作?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6627545/
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
.dll only works properly on Windows XP and Vista but not 7?
提问by newbtophp
I have a windows .dll file (from a third-party - which have discontinued supporting it and I don't have the C sourcecode to rectify the problems).
我有一个 windows .dll 文件(来自第三方 - 已经停止支持它,我没有 C 源代码来纠正这些问题)。
I'm using the .dll in a project of mine.
我在我的一个项目中使用 .dll。
The .dll file works perfectly fine under Windows XP/Vista (as it was released at the time of when these OS versions were current/latest) - the issue is now that the project is now limited to Windows XP/Vista users (due to that .dll) - when it runs under Windows 7 it slightly malfunctions (ie. produces different results then compared to Windows XP/Vista).
.dll 文件在 Windows XP/Vista 下工作得很好(因为它是在这些操作系统版本是当前/最新版本时发布的) - 现在的问题是该项目现在仅限于 Windows XP/Vista 用户(由于该 .dll) - 当它在 Windows 7 下运行时会出现轻微故障(即产生与 Windows XP/Vista 相比不同的结果)。
I believe the problem is Microsoft must have changed something (within the Windows library or something?) which is effecting the compatibility.
我相信问题是微软必须改变了一些影响兼容性的东西(在 Windows 库中还是什么?)。
So I was wondering - I know its not really the best option but as a temporary/hackish workaround is their someway I can emulate Windows XP/Vista functionality for the Windows 7 users, ie. is their any projects designed for this - example => http://www.busybox.net/about.html(which allows Linux functionality to be able to be executed on Windows).
所以我想知道 - 我知道它不是最好的选择,但作为临时/黑客的解决方法是他们的某种方式,我可以为 Windows 7 用户模拟 Windows XP/Vista 功能,即。是他们为此设计的任何项目 - 示例 => http://www.busybox.net/about.html(它允许 Linux 功能能够在 Windows 上执行)。
Appreciate all suggestions/workarounds.
感谢所有建议/解决方法。
采纳答案by Reed Copsey
In Windows 7, you can run an executable in Compatibility Mode, and set it to run in a mode compatible with Windows XP. For details, see Make older programs run in this version of Windows.
在 Windows 7 中,您可以在兼容模式下运行可执行文件,并将其设置为在与 Windows XP 兼容的模式下运行。有关详细信息,请参阅使旧程序在此版本的 Windows 中运行。
Note that, you can't force this .DLL to always use a compatibility mode, but you can change your installer to make the appropriate registry settings for the user or machine that do this.
请注意,您不能强制此 .DLL 始终使用兼容模式,但您可以更改安装程序,为执行此操作的用户或计算机进行适当的注册表设置。
All you need to do is add a registry key as follows. Under:
您需要做的就是添加一个注册表项,如下所示。在下面:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Application Compatibility\Layers
Add a key like:
添加一个键,如:
"Path\To\Program\YourExecutable.exe"=WINXPSP2
This will cause your program to always run under compat mode. You can also set this in HKCU if you prefer to just set it for the current user.
这将导致您的程序始终在兼容模式下运行。如果您更愿意为当前用户设置它,您也可以在 HKCU 中设置它。
回答by flolo
That sounds too easy: But what about Windows Compatibility Mode? Maybe it works.
这听起来太简单了:但是 Windows 兼容模式呢?也许它有效。
回答by Steve Townsend
You could try running your app on Windows 7 under Windows XP Compatibility modeand compare the results to those from native Windows XP.
您可以尝试在Windows XP 兼容模式下在 Windows 7 上运行您的应用程序,并将结果与本机 Windows XP 的结果进行比较。