Thanks all, when called from the other app.exe, it always returned zero until I disabled Application Framework and set the ExitCode in the New / Finalize
No idea if it can work with Application Framework enabled or not :(
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have 2 VB.net WinForms app (.net 4.0) one is x64 one is x86
From the x64 one, I call the x86 one and need to get back its return code.
Code inside the x64 app:
Using Compiler As New Process
Compiler.StartInfo.WorkingDirectory = My.Application.Info.DirectoryPath
Compiler.StartInfo.FileName = "App.exe"
Compiler.StartInfo.UseShellExecute = False
Compiler.StartInfo.RedirectStandardOutput = False
Compiler.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
Compiler.EnableRaisingEvents = True
Compiler.Start()
Compiler.WaitForExit()
If Compiler.HasExited = False Then
Compiler.Kill()
Else
MsgBox(Compiler.ExitCode)
End If
End Using
And the second x86 app, in the form load., I use:
Environment.ExitCode = xxx
'Environment.Exit(xxx)
Application.Exit()
The problem is that I always get zero as return code :(
Anyone knows why?
Thanks.
Thanks all, when called from the other app.exe, it always returned zero until I disabled Application Framework and set the ExitCode in the New / Finalize
No idea if it can work with Application Framework enabled or not :(
Hi @StewartBW
Disabling the Application Framework ensures that your custom exit code logic is not overridden.
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.