I have a project in Visual Studio. The thing is that when I open the project with Visual and hit start in release mode, the program works correctly and without any problem.
However, when I run the already compiled program from the .exe executable, the behavior is slightly different, and it doesn't work quite right.
I know there are differences between running the program in release or in debug, but I am running the program in release, and then the executable also from the release folder. So it should be the same.
The behavioral differences are as follows:
The program at a given moment executes a second program (CATIA) to obtain a result. This from the release mode of Visual Studio does not give any kind of problem, the second program is always launched. However from the executable .exe the second program is not always launched.
This is the code fragment responsible for launching the second program:
My question is, why is this happening? Could it be something related to permissions? Why is the behavior different? And how can I solve it or avoid this difference in behavior between running the program in one way or another.
I have managed to solve it.
The problem was that when the second program was closed, a process was left open, therefore it did not close completely, so later when it tried to open it again it failed.
So now in the method that I use to close the program, I also do a 'kill' to make sure the process is closed as well.
This did not happen executing it from the Release of the IDE. But at least now it works properly.