Converting API return values to Return Codes?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lars Netzel

    #1

    Converting API return values to Return Codes?

    I need to use a few WIN API functions and get Return values as Long and
    Integers from those.. how do I convert these to the error codes so I get to
    know what error I really got?

    Example from MSDN site:
    http://msdn.microsoft.com/library/de...ternetdial.asp
    Return Values
    Returns ERROR_SUCCESS if successful, or an error value otherwise. The error
    code can be one of the following values.
    ERROR_INVALID_P ARAMETER, One or more of the parameters are incorrect.
    ERROR_NO_CONNEC TION, There is a problem with the dial-up connection.
    ERROR_USER_DISC ONNECTION, The user clicked either the Work Offline or
    Cancel button on the Internet connection dialog box.



    I get numbers as 797, 631 and 0 from this api. I have understood , from
    trial and error, that 0 is success.. but how to I translate the other ones
    to the real message?

    best regards
    /Lars Nezel


  • Herfried K. Wagner [MVP]

    #2
    Re: Converting API return values to Return Codes?

    "Lars Netzel" <uihsdf@adf.s e> schrieb im Newsbeitrag:[color=blue]
    >I need to use a few WIN API functions and get Return values as Long and
    >Integers from those.. how do I convert these to the error codes so I get to
    >know what error I really got?
    >
    > Example from MSDN site:
    > http://msdn.microsoft.com/library/de...ternetdial.asp
    > Return Values
    > Returns ERROR_SUCCESS if successful, or an error value otherwise. The
    > error code can be one of the following values.
    > ERROR_INVALID_P ARAMETER, One or more of the parameters are
    > incorrect.
    > ERROR_NO_CONNEC TION, There is a problem with the dial-up connection.
    > ERROR_USER_DISC ONNECTION, The user clicked either the Work Offline or
    > Cancel button on the Internet connection dialog box.[/color]

    See:

    <URL:http://groups.google.d e/group/microsoft.publi c.dotnet.langua ges.vb/msg/a8e93b25e4feb27 b>

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    Working...