Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 9:04
Andraw Tang24-May-11 9:04 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 8:45
Andraw Tang24-May-11 8:45 
GeneralRe: there probably is a mistake somewhere Pin
Dave Kreskowiak24-May-11 8:51
mveDave Kreskowiak24-May-11 8:51 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 9:27
Andraw Tang24-May-11 9:27 
GeneralRe: there probably is a mistake somewhere Pin
Dave Kreskowiak24-May-11 9:49
mveDave Kreskowiak24-May-11 9:49 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 9:41
Andraw Tang24-May-11 9:41 
GeneralRe: there probably is a mistake somewhere Pin
Dave Kreskowiak24-May-11 9:51
mveDave Kreskowiak24-May-11 9:51 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 12:13
Andraw Tang24-May-11 12:13 
Thanks, David.

After I remove calling WaitForExit() and ReadToEnd(), the progressbar works now, but the Exited event function OnProcesited is not called, so the progressbar is always shown. How can I make OnProcesited() be called?


Private Sub OnProcesited(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim p As System.Diagnostics.Process
        p = sender

        Dim rtnStr As String = String.Empty
        rtnStr = p.StandardOutput.ReadToEnd()

        If rtnStr.Contains(" FAST terminated normally.") = True Then
            rtnStr = rtnStr & vbCrLf & "Please click Postprocess -> View Output File in menu to view the file."
            updateViewMenu()
        End If
        progBarFrm.Close()
        progBarFrm.Dispose()

        Dim frm As New FormShowFASTResult
        frm.txtFASTResult.Text = rtnStr
        frm.Button1.Select()
        frm.ShowDialog()

    End Sub


    Private Sub Run_Tool()

        Dim sAppPath As String = ".\XXXXX.exe"
        Dim fileName As String = "XXXXX.txt"
        Dim p As New System.Diagnostics.Process()



        p.StartInfo.FileName = Application.StartupPath & "\" & sAppPath
        p.StartInfo.Arguments = fileName

        'Do not use the system shell to start the program this is so we can hide the command dos window
        p.StartInfo.UseShellExecute = False
        p.StartInfo.WorkingDirectory = strOutputFilePath
        ' Show no dos window if false
        p.StartInfo.CreateNoWindow = True
        p.StartInfo.RedirectStandardOutput = True
        p.EnableRaisingEvents = True
        AddHandler p.Exited, AddressOf OnProcesited


        progBarFrm = New FormProgressBar

        Try
            p.Start()

            progBarFrm.Show()
            progBarFrm.Refresh()            
        Catch ex As Exception
            ShowValidationMessage("Unexception error is caught, please close and try again.", "Error")
            
            Return
        End Try    
   End Sub

GeneralRe: there probably is a mistake somewhere Pin
Dave Kreskowiak24-May-11 12:26
mveDave Kreskowiak24-May-11 12:26 
QuestionVB.NET Handle SQL DB in Multi user application Pin
All Time Programming23-May-11 20:44
All Time Programming23-May-11 20:44 
AnswerRe: VB.NET Handle SQL DB in Multi user application Pin
AspDotNetDev23-May-11 22:01
protectorAspDotNetDev23-May-11 22:01 
GeneralRe: VB.NET Handle SQL DB in Multi user application Pin
All Time Programming23-May-11 22:34
All Time Programming23-May-11 22:34 
GeneralRe: VB.NET Handle SQL DB in Multi user application Pin
Thomas Krojer23-May-11 23:13
Thomas Krojer23-May-11 23:13 
GeneralRe: VB.NET Handle SQL DB in Multi user application Pin
Dave Kreskowiak24-May-11 1:21
mveDave Kreskowiak24-May-11 1:21 
GeneralRe: VB.NET Handle SQL DB in Multi user application Pin
All Time Programming24-May-11 1:36
All Time Programming24-May-11 1:36 
GeneralRe: VB.NET Handle SQL DB in Multi user application Pin
Dave Kreskowiak24-May-11 1:55
mveDave Kreskowiak24-May-11 1:55 
GeneralRe: VB.NET Handle SQL DB in Multi user application Pin
All Time Programming24-May-11 1:58
All Time Programming24-May-11 1:58 
Questiongetting value of the textbox to be used in crystal report Pin
clarence_1323-May-11 16:35
clarence_1323-May-11 16:35 
AnswerRe: getting value of the textbox to be used in crystal report Pin
thatraja23-May-11 17:17
professionalthatraja23-May-11 17:17 
GeneralRe: getting value of the textbox to be used in crystal report Pin
clarence_1325-May-11 14:57
clarence_1325-May-11 14:57 
AnswerRe: getting value of the textbox to be used in crystal report Pin
thatraja25-May-11 15:50
professionalthatraja25-May-11 15:50 
GeneralRe: getting value of the textbox to be used in crystal report Pin
clarence_1325-May-11 20:02
clarence_1325-May-11 20:02 
GeneralRe: getting value of the textbox to be used in crystal report Pin
clarence_1325-May-11 20:42
clarence_1325-May-11 20:42 
QuestionPDF parser Pin
εїзεїзεїз23-May-11 9:44
εїзεїзεїз23-May-11 9:44 
AnswerRe: PDF parser Pin
Dalek Dave23-May-11 13:20
professionalDalek Dave23-May-11 13:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.