|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
pp with a gui and a cmd line interfaceI've got an application that I would like to have both a GUI and a command
line interface. It is easy enough to check for command line arguments. The proplem is that if I set my project output type to "Windows Application", Console.Writeline doesn't write back to the console (it writes back to the IDE when debugging). But if I et my project output type to "Console Application", whenever I start my app from the Start Menu, I get a console in addition to my GUI. Is there a way to work around either of these situations? I need to: A) find a way to write to the console in a windows application or B) stop the console from appearing in a console application thanks > I need to: If you write to the console (in vb, Console.Write("whatever")) in a windows > A) find a way to write to the console in a windows application app, you will see the console output if you pipe stdout to 'more'. Assume your app name is xxx.exe, at the command prompt type xxx | more. This may also be an architecture issue. Maybe you should create an set of
classes that implement all the behavior and then create separate console/GUI frontends using those classes. You would end up with 2 separate .EXE files but it may be better in the long run? -- Show quote~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Charles Cox VC/VB/C# Developer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Eric" <E***@discussions.microsoft.com> wrote in message news:4C2445C1-8396-4152-8978-3E104BBD3DAF@microsoft.com... > > I've got an application that I would like to have both a GUI and a command > line interface. It is easy enough to check for command line arguments. The > proplem is that if I set my project output type to "Windows Application", > Console.Writeline doesn't write back to the console (it writes back to the > IDE when debugging). But if I et my project output type to "Console > Application", whenever I start my app from the Start Menu, I get a console > in > addition to my GUI. > > Is there a way to work around either of these situations? > > I need to: > A) find a way to write to the console in a windows application > > or > > B) stop the console from appearing in a console application > > thanks |
|||||||||||||||||||||||