1

I tried to get output in console program, but i got error maybe I think that the error is about 'deadlock' I pass night without sleep doing search solution that this error, I can't find anyone can help me?

Someone tell me about the solution to fix it, it seems to make inherit system. and he refer : http://programming.nullanswer.com/question/27270022 but this is java not vb.net.

Error Message:

'CTextConsoleWin32::GetLien: !GetNumberOfConsoleInputEvents'

    Dim cmdCommand As String
    getgame()
    Serverlog.Clear()
    Serverlog.Text += "ServerName : " & SelectedServer.Item(8) & " / " & "Server Download Path : " & SelectedServer.Item(9) & vbCrLf

    Dim mapname As String = Split(SelectedServer.Item(2), ".bsp")(0)
    cmdCommand = "-console -game " & SelectedServerGame & " -tickrate " & SelectedServer.Item(5) & " -port " & SelectedServer.Item(11) & " -maxplayers_override " & SelectedServer.Item(4) & " +map " & mapname

    Serverlog.Text += (cmdCommand) & vbCrLf

    Dim start_info As New ProcessStartInfo()
    start_info.FileName = SelectedServer.Item(0)
    start_info.UseShellExecute = False
    'start_info.CreateNoWindow = True
    start_info.RedirectStandardError = True
    start_info.RedirectStandardOutput = True
    start_info.RedirectStandardInput = True
    'start_info.WindowStyle = ProcessWindowStyle.Hidden
    start_info.Arguments = cmdCommand

    Dim proc As New Global.System.Diagnostics.Process
    proc.StartInfo = start_info
    proc.Start()


    Dim std_out As StreamReader = proc.StandardOutput
    Do
        proc.WaitForInputIdle()
        Dim line As String = Await std_out.ReadLineAsync()
        'Serverlog.Text += std_out.ReadLine & vbCrLf
        Serverlog.Invoke(Sub() Serverlog.Text += line & vbCrLf)
    Loop While proc.HasExited = False
miroxlav
  • 11,796
  • 5
  • 58
  • 99
D. Duck
  • 11
  • 2
  • What line throws the error? – Eraph Sep 18 '15 at 02:59
  • @Eraph no error in visual studio. loaded program in visual studio, it occur the error . the process of Output is in doubt. – D. Duck Sep 18 '15 at 03:22
  • Is the error always there or only sometimes? – miroxlav Sep 18 '15 at 05:15
  • @miroxlav no. just run, occur error – D. Duck Sep 18 '15 at 06:39
  • when i start the program, occur error in program . not occur in visual studio 2013 editor – D. Duck Sep 18 '15 at 06:46
  • possible duplicate of [How to get Output of a Command Prompt Window line by line in Visual Basic?](http://stackoverflow.com/questions/26347823/how-to-get-output-of-a-command-prompt-window-line-by-line-in-visual-basic) => Preferred way to read console output is different. Please check linked duplicate, it works without problems. – miroxlav Sep 20 '15 at 09:21
  • this problem solved with running on Windows 8 or higher version. – D. Duck Sep 29 '15 at 11:58

0 Answers0