Hello Everyone,
I have this little app, that I would like to configure two modes of
operation by using command line arguments. If the app is started with no
arguments, the Main UserForm shows up, if the app is started with an argument
of -q it runs in Quiet Mode. Where a form pops up, runs the process I need
run without user intervention and then closes. I'm having a problem when the
app runs with -q, it starts the Quiet Mode form... but doesn't process any of
the code for the next steps I need run. Can someone help me out. I have
posted pertinent code snippets below.
-----------------------------------------------------
Module ProgramCode
Public Sub Main(ByVal CmdArgs() As String)
If (CmdArgs Is Nothing) OrElse (CmdArgs.Length = 0) Then
Application.Run(New frmMain)
ElseIf CmdArgs(0).Trim.ToLower = "-q" Then
Application.Run()
Dim quietForm As New frmQuiet
quietForm.QuietModeProcess()
End If
End Sub
End Module
-------------
Public Class frmQuiet
Inherits System.Windows.Forms.Form
Const applicationName = "OFAC File Generator"
#Region " Windows Form Designer generated code "
#End Region
Public Sub QuietModeProcess()
MsgBox("Now Procecssing Quiet Mode Steps", MsgBoxStyle.Information,
applicationName)
End Sub
End Class
--
Freedom isn't free... but the United States Marine Corps will pay most of
your share !!! Semper Fi!! 3 1345
Dubya <jw*****@gmail.com> wrote: I have this little app, that I would like to configure two modes of operation by using command line arguments. If the app is started with no arguments, the Main UserForm shows up, if the app is started with an argument of -q it runs in Quiet Mode. Where a form pops up, runs the process I need run without user intervention and then closes. I'm having a problem when the app runs with -q, it starts the Quiet Mode form... but doesn't process any of the code for the next steps I need run. Can someone help me out. I have posted pertinent code snippets below.
You're calling Application.Run(), which will block until either Exit or
ExitThread is called. I very much doubt that that's what you want it to
do. Why are you calling it at all?
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
I am using the Application.Run because if I use frmQuiet.Show to show the
form, the application quickly starts and shows the form, does no processing
and closes. I am a newer programmer and probably haven't architected this
quite right.
Any suggestions?
--
Freedom isn't free... but the United States Marine Corps will pay most of
your share !!! Semper Fi!!
"Jon Skeet [C# MVP]" wrote: Dubya <jw*****@gmail.com> wrote: I have this little app, that I would like to configure two modes of operation by using command line arguments. If the app is started with no arguments, the Main UserForm shows up, if the app is started with an argument of -q it runs in Quiet Mode. Where a form pops up, runs the process I need run without user intervention and then closes. I'm having a problem when the app runs with -q, it starts the Quiet Mode form... but doesn't process any of the code for the next steps I need run. Can someone help me out. I have posted pertinent code snippets below.
You're calling Application.Run(), which will block until either Exit or ExitThread is called. I very much doubt that that's what you want it to do. Why are you calling it at all?
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
Dubya <jw*****@gmail.com> wrote: I am using the Application.Run because if I use frmQuiet.Show to show the form, the application quickly starts and shows the form, does no processing and closes. I am a newer programmer and probably haven't architected this quite right.
Any suggestions?
Well, you haven't shown where you expect the actual processing to occur
in quiet mode. Do you need to show a UI at all? Why not just run the
processing and then quit?
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: joe |
last post by:
Hello,
I have the following commands:
testb -s <size>
testb -s <size> -o <input file>
testb -s <size> -o <codes>
How do i split the commands so that all three are valid. And how do i
check...
|
by: Mike D |
last post by:
I use stored procedures in my asp using the connection object. I validate
any inputs to protect myself from SQL injection. Why is it, or isn't it
better to use the command object? I have used...
|
by: Eli Criffield |
last post by:
I'm try run an ssh command in pexpect and I'm having trouble getting
everything escaped to do what i want.
Here's a striped down script showing what i want to do.
--
#!/usr/bin/env python...
|
by: SunRise |
last post by:
Hi
I am creating a C Program , to extract
only-Printable-characters from a file ( any type of file) and display
them.
OS: Windows-XP
Ple help me to fix the Errors & Warnings and explain...
|
by: PAPutzback |
last post by:
The process and execute methods want a path to the executable otherwise
they kick out a file not found. So how can I execute the following. It
works fine from a command window.
echo password|...
|
by: Dubya |
last post by:
Hello Everyone,
I have this little app, that I would like to configure two modes of
operation by using command line arguments. If the app is started with no
arguments, the Main UserForm shows...
|
by: Dubya |
last post by:
Hello Everyone,
I have this little app, that I would like to configure two modes of
operation by using command line arguments. If the app is started with no
arguments, the Main UserForm shows...
|
by: John Salerno |
last post by:
Here's my new project: I want to write a little script that I can type
at the terminal like this:
$ scriptname package1
where scriptname is my module name and any subsequent arguments are the...
|
by: Chris Carlen |
last post by:
Hi:
Having completed enough serial driver code for a TMS320F2812
microcontroller to talk to a terminal, I am now trying different
approaches to command interpretation.
I have a very simple...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |