G
Guest
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
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