473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sending command line arg to GUI

KC
How can I pass command line arguments to an app that has a regular windows
form as an interface? I know I need a 'Sub Main' method, but then do I have
to run my real 'main' form as an instance in the Sub Main?

-----
Ken
Nov 21 '05 #1
2 1049
"KC" <yo*@dontneed.this> schrieb:
How can I pass command line arguments to an app that has a regular windows
form as an interface? I know I need a 'Sub Main' method, but then do I
have
to run my real 'main' form as an instance in the Sub Main?


\\\
Public Module Program
Public Sub Main(ByVal Args() As String)
...
Application.Run(New MainForm())
End Sub
End Module
///

Select 'Sub Main' as startup object in the project properties.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2
"KC" <yo*@dontneed.this> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
How can I pass command line arguments to an app that has a regular windows
form as an interface? I know I need a 'Sub Main' method, but then do I have to run my real 'main' form as an instance in the Sub Main?


Yes.

Public Sub Main(ByVal args() As String)
Dim frm As New Form1
Application.Run(frm)
End Sub
hope that helps..
Imran.
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: d davis | last post by:
I realize that I am getting way ahead of myself. I am studying Learning Perl Win32, Programming Perl and Mastering Perl Tk. For a practical example that I can see that works doing something that I...
4
by: Scott | last post by:
I am using a TCPIP connection to communicate over port 23 (telnet) to a server, and I am having to mimic normal command line interface you owuld see in a telnet session (i.e. I have to write to...
3
by: Wayne | last post by:
I have a console application (ssh2.exe) that requires keystrokes to be sent to it after activating. I have worked that it needs to be started in it own thread, but capturing the process and...
9
by: savvy | last post by:
i'm trying to compile a simple console application for sending a mail, my main idea is to schedule it to a particular time for sending mails using the windows schedular task lateron. Therefore i...
9
by: Sandy | last post by:
can mfc application, send text data to opened notepad file in desktop?(live transfer of data) . can anybody help
5
by: Mark A. Sam | last post by:
Hello, I am sending two emails from the same procedure, one to myself (while testing) and another (a comfirmation) to the user on the website. I was having difficulty finding a relay server to...
11
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from...
3
by: Daniel Clark | last post by:
I have a Windows command line based application that only shuts down cleanly if it sees "CTRL-C" on the console. I need to automate the running of this application, but still allow the user sitting...
0
by: misra | last post by:
Hi, I am using a C# code to call blat and send mail. When I send mails with long sentences, the mail automatically is send with multiple lines. However, certain times the body and format of the...
1
by: the_ricka | last post by:
Hi all, I'm fairly new to python, but very excited about it's potential. I'm trying to write a simple program that will accept input from a command line and send email. The parameters I used on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.