Home All Groups Group Topic Archive Search About

pp with a gui and a cmd line interface

Author
27 Jan 2006 9:37 PM
Eric
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

Author
27 Jan 2006 10:26 PM
AMercer
> I need to:
> A) find a way to write to the console in a windows application

If you write to the console (in vb,  Console.Write("whatever")) in a windows
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.
Author
28 Jan 2006 12:10 AM
C.C. (aka Me)
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?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Show quote
"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

AddThis Social Bookmark Button