Decode HResult = -2147467259

依然范特西╮ 提交于 2019-11-29 20:55:43

I'll show you how to do it. Paste the negative number into Calculator (Windows) in programmer mode "Dec" setting. Then convert to "Hex" setting. You get the number: FFFFFFFF80004005. The error is 80004005 which is:

0x80004005
E_FAIL
Unspecified 

Unfortunately the provider of the function that gave you this error did not categorize the error.

Useful links:

  1. MSDN - HRESULT Format
  2. MSDN - HRESULT Error List

Print it as an hexadecimal number, then, use for instance, VisualStudio ErrorLookup, to get the message.

-2147467259 in decimal is 80004005 in hexadecimal (usually rendered as 0x80004005). That's "E_FAIL (Unspecified error)" in Win32.

Not a very helpful error code, but maybe it'll get you a half-step closer to a solution.

Another way to do it is as follows. An HRESULT should contain a System Error Code in its first 32 bits. Using an AND operation will retrieve the error code from the HRESULT:

int result = (-2147467259 & 0xFFFF)

result is 16389, which is not a part of the System Error Codes list, and as a result, is unspecified.

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