Click here to Skip to main content
15,898,949 members
Home / Discussions / C#
   

C#

 
GeneralRe: String Replacment Pin
David Stone8-Jan-03 14:01
sitebuilderDavid Stone8-Jan-03 14:01 
GeneralATTN: Win CE experts Pin
Jassim Rahma8-Jan-03 10:16
Jassim Rahma8-Jan-03 10:16 
GeneralRe: ATTN: Win CE experts Pin
Codin' Carlos8-Jan-03 10:42
Codin' Carlos8-Jan-03 10:42 
GeneralRe: ATTN: Win CE experts - HERE YOU GO Pin
Codin' Carlos8-Jan-03 10:50
Codin' Carlos8-Jan-03 10:50 
GeneralRe: ATTN: Win CE experts Pin
Shaun Wilde10-Jan-03 5:22
Shaun Wilde10-Jan-03 5:22 
GeneralScreen Resolution Pin
Jassim Rahma8-Jan-03 10:12
Jassim Rahma8-Jan-03 10:12 
GeneralRe: Screen Resolution Pin
SHaroz9-Jan-03 13:21
SHaroz9-Jan-03 13:21 
GeneralConsolizing a Windows Form program Pin
Le centriste8-Jan-03 9:38
Le centriste8-Jan-03 9:38 
I have a Windows Form application that helps build a XML file which has a menu item to make it perform a translation to another format (MC in my case).

I would like this application to be usable at the command line, like in a batch file, so it can be included in a build process. Obviously, I don't want any windowing when run from the command line. To achieve this trick, I simply check if there is some command line parameters. If there is no command line parameter, I start the Windows form.

I modified the main fuction from:

static void Main() 
{
     Application.Run(new MsgEditorMainForm());
}


to

static void Main() 
{
    string[] cmdLine = Environment.GetCommandLineArgs();

    if (cmdLine.Length > 1)
    {
        Console.Out.WriteLine("MessageEditor: Translation from <" + cmdLine[2] + "> to <" + cmdLine[3] + ">");
    }
    else
    {
	Application.Run(new MsgEditorMainForm());
    }
}


(error handling stripped for clarity)

The problem is that the Console.Out.WriteLine... don't produce any output, even if I start the application from a command prompt.

What is wrong?
GeneralRe: Consolizing a Windows Form program Pin
leppie8-Jan-03 11:28
leppie8-Jan-03 11:28 
GeneralRe: Consolizing a Windows Form program Pin
Le centriste9-Jan-03 3:56
Le centriste9-Jan-03 3:56 
GeneralRe: Consolizing a Windows Form program Pin
leppie9-Jan-03 6:05
leppie9-Jan-03 6:05 
GeneralRe: Consolizing a Windows Form program Pin
Le centriste9-Jan-03 19:38
Le centriste9-Jan-03 19:38 
GeneralNeed help Synchronizing Scrollbars Pin
bubbadurand8-Jan-03 9:19
bubbadurand8-Jan-03 9:19 
QuestionHow does a Component get its parent form Pin
charliedurrant8-Jan-03 8:34
charliedurrant8-Jan-03 8:34 
AnswerRe: How does a Component get its parent form Pin
Pete Bassett8-Jan-03 22:28
Pete Bassett8-Jan-03 22:28 
GeneralRe: How does a Component get its parent form Pin
charliedurrant9-Jan-03 6:07
charliedurrant9-Jan-03 6:07 
GeneralRe: How does a Component get its parent form Pin
leppie9-Jan-03 6:17
leppie9-Jan-03 6:17 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:03
James T. Johnson11-Jan-03 0:03 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:05
James T. Johnson11-Jan-03 0:05 
AnswerRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:01
James T. Johnson11-Jan-03 0:01 
GeneralRe: How does a Component get its parent form Pin
leppie11-Jan-03 0:31
leppie11-Jan-03 0:31 
GeneralRe: How does a Component get its parent form Pin
James T. Johnson11-Jan-03 0:42
James T. Johnson11-Jan-03 0:42 
GeneralRe: How does a Component get its parent form Pin
leppie11-Jan-03 1:39
leppie11-Jan-03 1:39 
GeneralRe: How does a Component get its parent form Pin
Anonymous12-Jan-03 3:15
Anonymous12-Jan-03 3:15 
GeneralRe: How does a Component get its parent form Pin
leppie12-Jan-03 6:06
leppie12-Jan-03 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.