views:

387

answers:

4

In a previous question, I asked what it meant when my program returned an obscure value like

-1073741819

Well, now I'm getting another large return value,

-1073740777

And I would like to know if there is some list of all of these values and what they mean sopmewhere?

+5  A: 

Well there's a bunch of them here,

http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx

But when I get one like your example I just Google the number.

Robert Harvey
+7  A: 

Generally you will get better search results if you print out the error number in hex, instead of signed decimal form.

For example, your first error is -1073741819 which can also be represented by 0xC0000005 in hex. This is an "access violation" error as google will quickly tell you.

Greg Hewgill
+1 for converting that to hex.
ChrisW
The hex for 1073740777 is 3ffffbe9, which doesn't have any google results.
Keand64
It's negative 1073740777, not positive.
Charlie Somerville
And what is negative 1073740777 in hex?
Keand64
If you use printf("%08x\n", (int)-1073740777); it's easy to get the right answer. If you use a calculator, enter 0x100000000 and subtract decimal 1073740777, then convert back to hex.
Jared Oberhaus
Thank you. That makes it c0000417, or invlaid runtime parameter.
Keand64
If you paste "-1073741819" into Windows Calculator (`calc.exe`) and then click the `Hex` radio button (when it's in its 'Scientific' View), then the result is FFFFFFFFC0000005, which you can see means 0xC0000005.
ChrisW
+5  A: 

Many of them (but not I think the ones related to COM) are in a header file named winerror.h.

In (some versions of) Visual Studio, under the 'Tools' menu, you might find an menu item named 'Error Lookup...'.

ChrisW
+5  A: 

Because the Windows error code system is extensible, there is no single place to look up all possible Windows error codes. However, you can start with:

  • Study the Structure of COM Error Codes. Sometimes knowing what facility an error comes from can help you discover what header file it comes from.
  • Visual Studio, since at least 2003, includes an ERRLOOK tool. Try that first if you're using Visual Studio.
  • Many of the codes you'll encounter are in Winerror.h. I've included a link to MSDN that contains the contents of that header file. Or you can look at the error code listing by number on this page.
  • Ideally you know what function returned the code, and then you can lookup the function on MSDN and look at all the possible return values. Of course, you'll need to refer to Winerror.h, or an another header file to get the actual values.
  • You can find (like Unix grep) in the Include directory of the platform SDK for either the hex value of the entire error code, or the decimal value of just the code section--that is, the lower 16 bits. Use HRESULT_CODE to extract that. See the Structure of COM Error Codes above.
  • There are a few error lookup tools where you can paste in a value and it looks it up in its database and tells you what it means. Look here and here.
  • Google. Use the full hex value. Sometimes you'll find very useful information, or at least clues.
Jared Oberhaus