How will ILCreateFromPath behave when error checki

2019-07-31 06:23发布

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条回答
时光不老,我们不散
2楼-- · 2019-07-31 07:15

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.

查看更多
登录 后发表回答