2012-08-13 77 views
2

我想在我的应用程序上使用MS Windows API代码包。在带有Windows API代码包的Windows XP上的EntryPointNotFoundException

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

它正常工作与Windows 7,同时提出了与Windows XP的错误(安装了.NET 3.5): “System.EntryPointNotFoundException:无法找到DLL“SHELL32名为 'SHCreateItemFromParsingName' 的切入点。 DLL”。”

能否告诉我在Windows XP上启动MS WACP需要做什么?

非常感谢!

回答

4

此方法已在Windows Vista中引入,在Windows XP中不存在。见its documentation
存在Windows API代码包以允许您对Windows 7进行托管访问,并且 - 我认为 - Windows Vista功能。 Windows XP中不存在这些功能,因此您无法使用它们。

1

API代码包依赖Windows 7 只有 API,所以它们在Windows XP上无效。您需要检查操作系统的版本,并且如果它不是Windows 7(或现在推测为Windows 8),则执行备用代码。