Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. Private Sub g_cServerInterface_FatalError(Error As enSvrReturns, ErrorString As String)
  2.  
  3. Dim sMsg As String
  4. Dim result As VbMsgBoxResult
  5.  
  6. m_bFatalError = True
  7.  
  8. UnFreeze
  9.  
  10. If m_cLanguageText Is Nothing Then
  11. GoTo TheEnd 'Form not yet loaded - not yet logged on
  12. End If
  13.  
  14. ' m_NumFatalErrors = m_NumFatalErrors + 1
  15. ' If m_NumFatalErrors > 5 Then
  16. ' Functions.DevInfo "Unable to restart Manitou.", g_cLangText_General
  17. ' End
  18. ' End If
  19.  
  20. If Error <> SVRERR_NOT_CONNECTED Or RunningInDebugger() Then
  21. sMsg = g_cLangText_General.GetText("A system error has occurred")
  22.  
  23. If ErrorString <> "" Then
  24. sMsg = sMsg & ":" & vbCrLf & vbCrLf & ErrorString & vbCrLf & vbCrLf
  25. Else
  26. sMsg = sMsg & ". "
  27. End If
  28.  
  29. sMsg = sMsg & g_cLangText_General.GetText("Press OK to attempt to restart or Cancel to quit.")
  30.  
  31. result = DevAskOkCancel(sMsg, Nothing)
  32. Else
  33. ' Since we've been disconnected, attempt immediately to reconnect
  34. result = vbOK
  35. End If
  36.  
  37. If (result = vbOK) Then
  38. On Local Error Resume Next
  39. If InStr(g_CommandLine, "-U") = 0 Then
  40. g_CommandLine = g_CommandLine & " -U" & g_cUser.id
  41. End If
  42. If InStr(g_CommandLine, "-P") = 0 Then
  43. g_CommandLine = g_CommandLine & " -P" & g_cUser.Password
  44. End If
  45. Shell App.Path & "" & App.EXEName & " " & g_CommandLine & " -X", vbNormalFocus
  46. DoEvents
  47. End If
  48.  
  49. TheEnd:
  50. If (Not RunningInDebugger()) Then
  51. ' Running as compiled executable
  52. ' Specifies the exit code for the process, and for all threads that
  53. ' are terminated as a result of this call. Use the GetExitCodeProcess
  54. ' function to retrieve the process's exit value. Use the GetExitCodeThread
  55. ' function to retrieve a thread's exit value.
  56.  
  57. CoUninitialize
  58. ExitProcess 0
  59. Else
  60. ' Running from the IDE
  61. End
  62. End If
  63.  
  64. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement