Okay, this is a tough one. I have an old EXE (compiled from FORTRAN) that dumps binary data to a file. When I run it from a DOS window, it does not put carriage returns after every WRITE statement. When I run it from my VB.NET program (see code below), it DOES put carriage returns after every statement!! (This observation is confirmed, wrote a second program to read the binary data with and w/o CRs, and it depends on whether I start it from a DOS window or with the code below.)
This is shocking! There is something very strange going on. It's the same compiled EXE, does the VB.NET direct towards a different write DLL or something??? The FORTRAN WRITE commands, by the way, are simple unformatted binary to an open file.
Would MUCH appreciate any ideas as to how this could be happening...
Private Sub Go(ByVal bRestart As Boolean)
Dim t As New Threading.Thread(AddressOf ThreadRun)
Private Sub ThreadRun()
p.StartInfo.FileName = My.Application.Info.DirectoryPath + "\" + ENGINE_FILE
p.StartInfo.Arguments = " " + m_Project.INPFile.FileName
p.StartInfo.UseShellExecute = False
p.StartInfo.WorkingDirectory = m_Project.ProjectPath
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.CreateNoWindow = True
p.StartInfo.RedirectStandardError = True
m_LastExitCode = p.ExitCode
Catch ex As Exception
RaiseEvent OnError(ex.Message, "cEngine.ThreadRun")