2017-05-02

How to Handle Decimal Windows Error Numbers

Occasionally, I receive error numbers from some program that are in decimal rather than the normal way that Windows discusses them, which is in hexadecimal. For example, I ran code contracts on a solution and it reported an error of -1073741571. To look up this error, several steps need to happen.

  1. Run the Windows calculator program. You can just type calc in the search on the task bar.
  2. Click on the menu icon in the upper left and select "Programmer".
  3. Click on "DEC" if it is not already selected.
  4. Type in -1073741571.
  5. Click HEX. The number comes back as FFFF FFFF C000 00FD.
  6. Ignore the top two bytes and search in your favorite search engine for C00000FD. This turns out to be a stack overflow exception. The exception is being caused by some bug in the code contracts when the Emit contracts into XML doc file checkbox is checked.
The Windows Calculator Program
The programming mode in the Windows calculator is not very well known. The other way to do conversions is to buy a HP-16C programming calculator on Ebay. None of the other calculators HP made were nearly as good for programming. I dearly love that calculator, but it's more trouble than its worth to go dig it out when the calculator in Windows is always there and you can copy and paste from it.

HP-16C Calculator

No comments :

Post a Comment