简体   繁体   English

带有 Windows API 代码包的 Windows XP 上的 EntryPointNotFoundException

[英]EntryPointNotFoundException on Windows XP with Windows API Code Pack

I am trying to use the MS Windows API Code Pack in my application.我正在尝试在我的应用程序中使用 MS Windows API 代码包。

string docRef = @"adocument.docx";
var shellFile = Microsoft.WindowsAPICodePack.Shell.ShellFile.FromFilePath(docRef);

It works fine with Windows 7, while it raises an error with Windows XP (with installed .NET 3.5):它在 Windows 7 上运行良好,但在 Windows XP(安装了 .NET 3.5)时引发错误:

"System.EntryPointNotFoundException: Unable to find an entry point named 'SHCreateItemFromParsingName' in DLL 'shell32.dll'." “System.EntryPointNotFoundException:无法在 DLL 'shell32.dll' 中找到名为 'SHCreateItemFromParsingName' 的入口点。”

What do I need to do to launch MS WACP on Windows XP?在 Windows XP 上启动 MS WACP 需要做什么?

This method has been introduced in Windows Vista and doesn't exist in Windows XP.此方法已在 Windows Vista 中引入,在 Windows XP 中不存在。 See its documentation .请参阅其文档
The Windows API Code pack exists to allow you managed access to Windows 7 and - I think - Windows Vista features. Windows API 代码包的存在是为了让您可以管理访问 Windows 7 和 - 我认为 - Windows Vista 功能。 These features simply don't exist in Windows XP, so you can't use them.这些功能在 Windows XP 中根本不存在,因此您无法使用它们。

The API Code Pack relies on Windows 7 only API's, so they are not valid on Windows XP. API 代码包依赖于 Windows 7 API,因此它们在 Windows XP 上无效。 You need to check the version of the operating system, and execute alternate code if it's not Windows 7 (or presumably Windows 8 now).您需要检查操作系统的版本,如果不是 Windows 7(或者现在可能是 Windows 8),则执行备用代码。

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

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