G
Guest
Hi,
I'm trying to add a couple of command line switches to a windows forms
application which will perform a short operation and possibly display a
message box to the user then immediately exit.
It works fine when I run from the debugger but if I run the app from a cmd
window the messageboxes show up with no text on the form or the ok button.
This simple application shows what I mean. If I run this from the VS
debugger it behaves as I would expect, but if I run it directly from a cmd
prompt I get blank message boxes.
(this is in VS 2005 with .net 2.0 btw)
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsApplication2
{
static class Program
{
[STAThread]
static void Main( string[] args )
{
foreach (string arg in args)
{
MessageBox.Show(arg);
}
}
}
}
I'm trying to add a couple of command line switches to a windows forms
application which will perform a short operation and possibly display a
message box to the user then immediately exit.
It works fine when I run from the debugger but if I run the app from a cmd
window the messageboxes show up with no text on the form or the ok button.
This simple application shows what I mean. If I run this from the VS
debugger it behaves as I would expect, but if I run it directly from a cmd
prompt I get blank message boxes.
(this is in VS 2005 with .net 2.0 btw)
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsApplication2
{
static class Program
{
[STAThread]
static void Main( string[] args )
{
foreach (string arg in args)
{
MessageBox.Show(arg);
}
}
}
}