Retrieves the error message associated with a given error code.
VB6/VBA
Debug.Print "Testing API_ErrorLookup ..."
Dim nRet As Long
Dim strErrMsg As String * 128
Dim i As Integer
For i = 0 To 10000
nRet = API_ErrorLookup(strErrMsg, Len(strErrMsg), i)
If (nRet > 0) Then
Debug.Print i & " = " & Left(strErrMsg, nRet)
End If
Next
Output
Testing API_ErrorLookup ... 0 = OK, success, no error (SUCCESS_NO_ERROR) 1 = Cannot open input file (OPEN_ERROR) 2 = Cannot create output file (CREATE_ERROR) ... 9999 = Miscellaneous error (MISC_ERROR)
VB.NET
Console.WriteLine("Testing API_ErrorLookup ...") ''Dim nRet As Integer Dim strErrMsg As String Dim i As Integer For i = 0 To 10000 strErrMsg = General.ErrorLookup(i) If (strErrMsg.Length > 0) Then Console.WriteLine(i & " = " & strErrMsg) End If Next
[Contents]