Re: Command Line

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ignacio Machin \( .NET/ C# MVP \) ("Ignacio)
Date: 10/01/04


Date: Fri, 1 Oct 2004 08:40:28 -0400

Hi,

 I'm a little confused, do you need to perform any input/output to the
console?
IF you do , then you have a problem ( see my other post)
IF you dont and all you need is to accept some parameters, perform some
action ( without using in any way the console ) and then create the form you
can do it using a windows app, just change the static void Main( ) to
static void Main( string[] args ) and remember that args[0] is the first
parameter, not the program being executed !!!

cheers,

-- 
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jarod" <Jarod@discussions.microsoft.com> wrote in message
news:5ACC7860-C548-4B07-8AE2-EC007601DDE0@microsoft.com...
> > Are you writing in C# or VB.NET? This is a C# group, but Sub Main looks
> > very much like VB.NET...
>
> Yeah it was mistake, because I also use a VB.Net.
> >
> > Writing something with both a command line interface and a windows
> > interface is relatively tricky, I believe. I suspect there's a way to
> > write a console application and then have it "disconnect" from the
> > console if you're running it in Windows mode, but I don't know how
> > you'd do the disconnection.
> >
> > To use command line parameters for your Windows app, just change the
> > signature of Main from
> >
> > static void Main()
> >
> > to
> >
> > static void Main (string[] args)
> >
> > and work from there.
> >
>
> But I have something like this:
> I wrote a Windows form application, and now I need to add some command
line
> parameter. The problem is, when I use Main(...) the program executes only
the
> main, no windows form interface starts :( I need the program to execute
> Main(...) and then to normaly run the windows up.
> Jarod


Relevant Pages

  • Handling error/status messages by interface to C++ programs
    ... commercial C++ compilers, such as, for example, Borland compilers, like C++ Builder. ... They can also run either in the console or Windows mode, and send appropriate error and status messages. ... The interface would later display the messages in this or other way. ...
    (comp.object)
  • Re: CreateProcessAsUser - Process starts then exits
    ... Windows XP Media Center ... public Int32 dwX; ... public IntPtr lpReserved2; ... parent's console. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: CreateProcessAsUser - Process starts then exits
    ... service most likely runs in a separate invisible session. ... the program I was trying to start was a windows forms app I ... public IntPtr lpReserved2; ... parent's console. ...
    (microsoft.public.win32.programmer.kernel)
  • Novell Client login form enables reading and writing from and to the clipboard of the logged-in
    ... Novell Client for Windows, ... Anyone with access to the computer's local operating system console, ... inject its own textual content into the clipboard of the currently logged-in ...
    (Bugtraq)
  • Re: Cannot Correctly Preview Fax in Fax Console
    ... I no way do I doubt what you are saying, but until now, all known problems with previewing faxes have had one of two causes: incorrect file associations for TIF files or end user error using Windows Picture and Fax viewer. ... >>>I have used the fax printer Windows accessory many times. ... The Fax console comes>>> up. ...
    (microsoft.public.windowsxp.print_fax)