How will ILCreateFromPath behave when error checking fails?

瘦欲@ 提交于 2019-12-11 07:29:04

问题


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?


回答1:


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.

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



来源:https://stackoverflow.com/questions/6227806/how-will-ilcreatefrompath-behave-when-error-checking-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!