Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.4 KiB

  1. Attribute VB_Name = "Errors"
  2. Option Explicit
  3. Const FACILITY_WIN32 As Long = 7
  4. ' These are Win32 Errors.
  5. ' They are tested against returns from WIN32 APIS using these
  6. ' error codes, BUT They must be translated into COM Errors
  7. ' using the HRESULT_FROM_WIN32 function below when
  8. ' returning then from a COM Object
  9. Public Const ERROR_FILE_NOT_FOUND As Long = 2
  10. Public Const ERROR_DISK_FULL As Long = 112
  11. ' These Are COM Errors
  12. Public Const E_NOTIMPL As Long = &H80004001
  13. Public Const E_FAIL As Long = &H80004005
  14. Public Const E_INVALIDARG As Long = &H80070057
  15. Public Const E_UNEXPECTED As Long = &H8000FFFF
  16. Public Const errBase As Long = vbObject + 9999
  17. Public Const errContainsGarbageChar As Long = errBase + 1
  18. Public Const errContainsStopSign As Long = errBase + 2
  19. Public Const errContainsStopWord As Long = errBase + 3
  20. Public Const errContainsOperatorShortcut As Long = errBase + 4
  21. Public Const errContainsVerbalOperator As Long = errBase + 5
  22. Public Const errAlreadyExists As Long = errBase + 6
  23. Public Const errDoesNotExist As Long = errBase + 7
  24. Public Const errTooLong As Long = errBase + 8
  25. Public Const errMultiWord As Long = errBase + 9
  26. Public Const errCancel As Long = errBase + 10
  27. Public Const errRefNodeCannotBeDescendent As Long = errBase + 11
  28. Public Const errDatabaseVersionIncompatible As Long = errBase + 12
  29. Public Const errNotConfiguredForNavigateLink As Long = errBase + 13
  30. Public Const errContainsQuote As Long = errBase + 14
  31. Public Const errParentCannotBeLeaf As Long = errBase + 15
  32. Public Const errBadKeywordsFormat As Long = errBase + 16
  33. Public Const errNodeOrTopicAlreadyModified As Long = errBase + 17
  34. Public Const errBadSpreadsheet As Long = errBase + 18
  35. Public Const errOutOfOrderingNumbers As Long = errBase + 19
  36. Public Const errNotPermittedForAuthoringGroup As Long = errBase + 20
  37. Public Const errAuthoringGroupDiffers As Long = errBase + 21
  38. Public Const errAuthoringGroupNotPresent As Long = errBase + 22
  39. Public Const errVendorStringNotConfigured As Long = errBase + 23
  40. Public Const errProductIdOrVersionMissing As Long = errBase + 24
  41. Function HRESULT_FROM_WIN32(ByVal lngWin32Err As Long) As Long
  42. If (lngWin32Err <> 0) Then
  43. HRESULT_FROM_WIN32 = lngWin32Err And &HFFFF
  44. HRESULT_FROM_WIN32 = HRESULT_FROM_WIN32 Or (FACILITY_WIN32 * &H10000)
  45. HRESULT_FROM_WIN32 = HRESULT_FROM_WIN32 Or &H80000000
  46. Else
  47. HRESULT_FROM_WIN32 = 0
  48. End If
  49. End Function
  50. Public Sub DisplayDatabaseLockedError( _
  51. )
  52. MsgBox "The database is locked because another user is saving his/her changes. " & _
  53. "Please try again later.", vbExclamation + vbOKOnly
  54. End Sub
  55. Public Sub DisplayDatabaseVersionError( _
  56. )
  57. MsgBox "The database version is incompatible.", vbExclamation + vbOKOnly
  58. End Sub
  59. Public Sub DisplayAuthoringGroupError( _
  60. )
  61. Select Case Err.Number
  62. Case errNotPermittedForAuthoringGroup
  63. MsgBox "Your Authoring Group does not have sufficient permissions to " & _
  64. "perform this operation.", _
  65. vbExclamation + vbOKOnly
  66. Case errAuthoringGroupDiffers
  67. MsgBox "You cannot modify something that was created in a different " & _
  68. "Authoring Group.", _
  69. vbExclamation + vbOKOnly
  70. Case errAuthoringGroupNotPresent
  71. MsgBox "The Database has not been configured with an Authoring Group.", _
  72. vbExclamation + vbOKOnly
  73. End Select
  74. End Sub