Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2010 从从VisualStudio2010表单调用的C可执行文件中获取返回值_Visual Studio 2010 - Fatal编程技术网

Visual studio 2010 从从VisualStudio2010表单调用的C可执行文件中获取返回值

Visual studio 2010 从从VisualStudio2010表单调用的C可执行文件中获取返回值,visual-studio-2010,Visual Studio 2010,我正在尝试从VB2010中创建的表单中执行使用gcc编译的C exe。C可执行文件有一个int main函数int mainargv[],argc 我已经能够使用以下方法将参数传递给函数: myProcess.StartInfo.UseShellExecute = False myProcess.StartInfo.RedirectStandardOutput = True myProcess.StartInfo.WorkingDirectory = Directory.

我正在尝试从VB2010中创建的表单中执行使用gcc编译的C exe。C可执行文件有一个int main函数int mainargv[],argc

我已经能够使用以下方法将参数传递给函数:

    myProcess.StartInfo.UseShellExecute = False
    myProcess.StartInfo.RedirectStandardOutput = True
    myProcess.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory
    myProcess.StartInfo.FileName = "trial4.exe"
    myProcess.StartInfo.CreateNoWindow = True


    If SelectedFileNames_Path > "" Then

        filename_strings = Chr(34) + SelectedFileNames_Path + Chr(34)

        If LocalTimeSelectBtn.Checked = True Then
            SelectedTime = LocalTime
        ElseIf GMTTimeSelectBtn.Checked = True Then
            SelectedTime = GMTTime
        End If

        myProcess.StartInfo.Arguments = SelectedTime + " " + filename_strings + " "

        AddHandler myProcess.OutputDataReceived, AddressOf NetOutputDataHandler

        SelectedFolder.Items.Clear()
        myProcess.Start()
        myProcess.BeginOutputReadLine()
        myProcess.Close()

    Else
        MsgBox(" Please select a directory before generating the CSV files ")
    End If
当使用参数执行Trial4.exe时,会有一个返回类型int,告知程序是否成功运行

我找不到任何方法可以从这个VB表单中的C可执行文件中获取返回值。我正在使用VisualStudio2010

非常感谢您的帮助

谢谢