Results 1 to 7 of 7

Thread: how do i find out what the numbers returned from my api call mean

  1. #1

    Thread Starter
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179

    Arrow

    how do i find out what the numbers returned from my api call mean
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  2. #2
    Lively Member
    Join Date
    Apr 2001
    Location
    Central NC
    Posts
    75
    If you have VC, look at:

    <VisStudioDir>\<VCDir eg VC98>\include\winerror.h

    If you don't have it, search the Microsoft site for winerror.h - you should find everything you need. Doing a search on 'win32 error' will also provide help.

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well they wouldnt necessarily be errors, so if you just use the Find function in windows to search through *.h (include files) in VC++'s include folder you should find them ...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    i'm not getting anywhere with this, so if someone can find out for me i would apreciate it.

    running regqueryinfokey i get a return of 87

    if anyone can find out what that means ....
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    This might be it :

    Code:
    // MessageId: ERROR_INVALID_PARAMETER
    //
    // MessageText:
    //
    //  The parameter is incorrect.
    //
    #define ERROR_INVALID_PARAMETER          87L    // dderror
    An invalid parameter im assuming
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6

    Thread Starter
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    i was hoping it would be more helpfull, but thanks for the help.

    thankfully
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  7. #7
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Sydney Australia
    Posts
    804
    Try this:

    Code:
    Declare Function FormatMessage Lib "kernel32" Alias "FormatMessageA" _
    (ByVal dwFlags As Long, lpSource As Any, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, _
    ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Long) As Long
      
    Public Const FORMAT_MESSAGE_ALLOCATE_BUFFER = &H100
    Public Const FORMAT_MESSAGE_ARGUMENT_ARRAY = &H2000
    Public Const FORMAT_MESSAGE_FROM_HMODULE = &H800
    Public Const FORMAT_MESSAGE_FROM_STRING = &H400
    Public Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000
    Public Const FORMAT_MESSAGE_IGNORE_INSERTS = &H200
    Public Const FORMAT_MESSAGE_MAX_WIDTH_MASK = &HFF
    Public Const LANG_USER_DEFAULT = &H400&
    
    Function GetLastErrorStr(dwErrCode As Long) As String
      Static sMsgBuf As String * 257, dwLen As Long
      dwLen = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM _
      Or FORMAT_MESSAGE_IGNORE_INSERTS Or FORMAT_MESSAGE_MAX_WIDTH_MASK, ByVal 0&, _
      dwErrCode, LANG_USER_DEFAULT, ByVal sMsgBuf, 256&, 0&)
      If dwLen Then GetLastErrorStr = Left$(sMsgBuf, dwLen)
    End Function
    Usage:

    Code:
    Dim x
    x = GetLastErrorStr(Val(Text1.Text))
    Label1.Caption = x

Posting Permissions

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



Click Here to Expand Forum to Full Width