I have a C++ program (Test.exe) that takes in a number N (passed as command line argument) and generates coordinates for N rectangles written to a text file.
I have tested this via the command line and in Visual Studio, and on both occasions the file is written with the expected output.
In a C# program I enter N in a textbox, click a button and my event code is as follows:
Process p = new Process();
p.StartInfo.FileName = "Test.exe";
p.StartInfo.Arguments = num;
p.Start();
// read the file that Test.exe created
A file is not written by Test.exe.
Any suggestions as to why Test.exe doesn't write the file when it is called from the C# program?
Problem Found The file was being written in the directory where the C# program was executed from NOT from where the C++ program was located.