I've created a Win32 console project using Visual Studio .NET 2003; the app reads from the standard input stream (cin). I want to redirect input to the app from a text file named test.dat, which is located in the project directory.
I open the properties dialog for the project, and under "Configuration Properties/Debugging", I change the value of "Command Arguments" to
< $(ProjectDir)test.dat
I make this change for "All Configurations", and I close the project properties dialog.
When I run the app by selecting "Debug/Start" from the main menu of the IDE, it runs fine, reading and processing data from the file test.dat.
But, when I run the app by selecting "Debug/Start Without Debugging" from the main menu of the IDE, it waits for input from the keyboard rather than reading from the redirected file. A little more experimentation uncovered the fact that the app, in this case, is viewing the "Command Arguments":
< $(ProjectDir)test.dat
as two command line arguments to the app, rather than viewing them as an input redirection.
Does anyone know a workaround for this, short of passing a file name into the app so it can open the file, or running from a command prompt window?
Thanks for any help you can provide.
I open the properties dialog for the project, and under "Configuration Properties/Debugging", I change the value of "Command Arguments" to
< $(ProjectDir)test.dat
I make this change for "All Configurations", and I close the project properties dialog.
When I run the app by selecting "Debug/Start" from the main menu of the IDE, it runs fine, reading and processing data from the file test.dat.
But, when I run the app by selecting "Debug/Start Without Debugging" from the main menu of the IDE, it waits for input from the keyboard rather than reading from the redirected file. A little more experimentation uncovered the fact that the app, in this case, is viewing the "Command Arguments":
< $(ProjectDir)test.dat
as two command line arguments to the app, rather than viewing them as an input redirection.
Does anyone know a workaround for this, short of passing a file name into the app so it can open the file, or running from a command prompt window?
Thanks for any help you can provide.