In Microsoft javascript is it possible to get the textual description of an error coming from an HRESULT?


I know the Error object 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 ) 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.

asked on Stack Overflow Oct 11, 2011 by Alessandro Jacopson • edited Oct 12, 2011 by Alessandro Jacopson

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0