错误检查失败时,ILCreateFromPath将如何表现? [英] How will ILCreateFromPath behave when error checking fails?

查看:117
本文介绍了错误检查失败时,ILCreateFromPath将如何表现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PSDK参考ILCreateFromPath没有任何信息说明该函数在失败时的行为(更重要的是,如何获取扩展的错误信息).

In the PSDK reference for ILCreateFromPath there is no information how the function behaves when it fails (and, more importantly, how to get extended error information).

我应该期望什么行为,以及如何获取该错误信息?

What behavior should I expect, and how can I get that error information?

推荐答案

在其他任何地方均未记录.如果失败,则返回NULL指针,并且没有可用的扩展错误信息.

It is not documented anywhere else. If it fails, it returns a NULL pointer, and there is no extended error info available what that happens.

请改用 SHParseDisplayName() (即使Microsoft表示它也是首选在ILCreateFromPath()上).它返回HRESULT,其中包含失败时的错误代码.

Use SHParseDisplayName() instead (even Microsoft says it is preferred over ILCreateFromPath()). It returns an HRESULT, which contains an error code on failure.

这篇关于错误检查失败时,ILCreateFromPath将如何表现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆