在 Microsoft javascript 中,是否可以从 HRESULT 获取错误的文本描述?
我知道 Error
对象 http://msdn.microsoft.com Microsoft javascript 中的 /en-us/library/dww52sbt。
一些错误来自 HRESULT
并且它们具有有效的 number
属性(例如 -2147023570 映射到 0x8007052E,请参阅 Eric Lippert 的“Making Sense of HRESULTS”<一个href="http://blogs.msdn.com/b/ericlippert/archive/2003/10/22/53267.aspx" rel="nofollow">http://blogs.msdn.com/b/ericlippert/archive /2003/10/22/53267.aspx )但是 message
属性(或 description
属性)为空(在我的示例中,文本为“登录失败:未知的用户名或错误密码。”)
我可以将 FormatMessage
调用(或 _com_error::ErrorMessage
)包装在一个 COM 对象,然后从我的脚本中调用它(这是一个从命令行使用 cscript
启动的脚本),但我想知道是否可以在没有外部组件的情况下获取文本描述,但是仅依靠“标准”Windows 安装。
I know the Error
object http://msdn.microsoft.com/en-us/library/dww52sbt in Microsoft javascript.
Some errors come from an HRESULT
and they have a valid number
property (for example -2147023570 which maps to 0x8007052E, see for example "Making Sense of HRESULTS" by Eric Lippert http://blogs.msdn.com/b/ericlippert/archive/2003/10/22/53267.aspx ) but the message
property (or description
property) is empty (in my example the text is "Logon failure: unknown user name or bad password.")
I can wrap a FormatMessage
call (or _com_error::ErrorMessage
) in a COM object and then call it from my script (it is a script launched with cscript
from the command line) but I would like to know whether it is possible to get the textual description without an external component but just relying on a "standard" Windows installation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论