HRESULT error code
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: HRESULT error code

  1. #1
    Join Date
    Nov 2001
    Location
    San Diego
    Posts
    102

    HRESULT error code

    Where can I go to find out what a specific HRESULT error code means. I have this error codes -1072882847 and I want to find out what it means. It happens when I am trying to start a windows media encoder session.

    Mike@spb

  2. #2
    Join Date
    Mar 2002
    Posts
    350
    You can use VS quickwatch window.
    just enter your value with ',hr' at the end and recalculate

    e.g
    if your HRESULT value name is 'rc' ,enter in the QuickWatch window 'rc,hr'

  3. #3
    Join Date
    Nov 2001
    Location
    San Diego
    Posts
    102
    Thanks, but what about when you get an error while testing the application. I am currently testing the application and I have setup an static box to display any HRESULT errors that may happen. This error does not happen while in debug mode but when I am actually testing the application (.exe) itself.


    Mike@spb

  4. #4
    Join Date
    Mar 2002
    Location
    Philadelphia
    Posts
    150

    HRESULT decode via <winerror.h>

    Convert your error code to a hex DWORD, i.e. -1072882847 converts to 0xC00D1B61.

    Then open <winerror.h> and use it to help you decode the error code.
    // excerpt from <winerror.h> ...
    // Values are 32 bit values layed out as follows:
    //
    // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
    // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
    // +---+-+-+-----------------------+-------------------------------+
    // |Sev|C|R| Facility | Code |
    // +---+-+-+-----------------------+-------------------------------+
    //
    // where
    //
    // Sev - is the severity code
    //
    // 00 - Success
    // 01 - Informational
    // 10 - Warning
    // 11 - Error
    //
    // C - is the Customer code flag
    //
    // R - is a reserved bit
    //
    // Facility - is the facility code
    //
    // Code - is the facility's status code

    i.e. 0xC00D1B61
    => Severity = 0xC = 1100 Error
    => Facility Code = 0xD =1101 MediaServer
    => 0x1b61 = 7009 decimal.

    Hope this helps.
    Good luck.

    -Ron

  5. #5
    Join Date
    Sep 2002
    Posts
    77
    There is also a "error look up" tool which ships with Visual Studio (...\Microsoft Visual Studio\Common\Tools\errlook.exe) and appears usually in the Tools-menu.

    Copy and paste (or drag and drop) your error code into the edit field of this tool and it will give a textual description.
    The tools searches the system libraries but it is also possible to add custom libraries which contain error resources created and compiled by the message compiler.

  6. #6
    Join Date
    Nov 2001
    Location
    San Diego
    Posts
    102
    Thanks, I tried that but it did not give me any answer.

    I am new to VC++ and now that I know to convert those HRESULTS value to hex I was able to do a search of the hex value on Microsoft's site and come up with the solution as to what this particular code meant.

    Mike@spb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center