473,387 Members | 1,561 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,387 software developers and data experts.

Sub Main

Hi all,

I am just wondering why I can't find the sub main in my
application. I know that the sub main is the entry point
for a program. Is it because the MS Visual Studio .Net
somehow hides the sub main?

Any suggestion would be appreciated.

regards,
Sean
Nov 21 '05 #1
8 2103
Hi,

There isnt one by default in vb.net windows application. Add a
module to your project add sub main and set it to be the startup object in
the projects properties.

Ken
----------------
"Sean" <an*******@discussions.microsoft.com> wrote in message
news:14****************************@phx.gbl...
Hi all,

I am just wondering why I can't find the sub main in my
application. I know that the sub main is the entry point
for a program. Is it because the MS Visual Studio .Net
somehow hides the sub main?

Any suggestion would be appreciated.

regards,
Sean
Nov 21 '05 #2
"Sean" <an*******@discussions.microsoft.com> schrieb:
I am just wondering why I can't find the sub main in my
application. I know that the sub main is the entry point
for a program. Is it because the MS Visual Studio .Net
somehow hides the sub main?


If a form class is selected as startup object in the project properties,
Visual Basic will implicitly generate the 'Sub Main' when compiling
automatically.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
There is only an "automatic" Sub Main, if you are in a Console Application,
not in Windows or ASP.NET applications.

"Sean" <an*******@discussions.microsoft.com> wrote in message
news:14****************************@phx.gbl...
Hi all,

I am just wondering why I can't find the sub main in my
application. I know that the sub main is the entry point
for a program. Is it because the MS Visual Studio .Net
somehow hides the sub main?

Any suggestion would be appreciated.

regards,
Sean

Nov 21 '05 #4
Hi all,

Thanks for your input. I really appreciate it.

regards,
Sean
-----Original Message-----
Hi all,

I am just wondering why I can't find the sub main in my
application. I know that the sub main is the entry point
for a program. Is it because the MS Visual Studio .Net
somehow hides the sub main?

Any suggestion would be appreciated.

regards,
Sean
.

Nov 21 '05 #5
"Scott M." <No****@NoSpam.com> schrieb:
There is only an "automatic" Sub Main, if you are in a Console
Application, not in Windows


That's not true. Even in Windows Forms applications, you don't need to
create a 'Sub Main'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
Huh? I didn't say that you do need a Sub Main in a Windows application. I
said there is NOT an automatic Sub Main made for you in a Windows
application and that there IS in a Console application.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uf**************@TK2MSFTNGP14.phx.gbl...
"Scott M." <No****@NoSpam.com> schrieb:
There is only an "automatic" Sub Main, if you are in a Console
Application, not in Windows


That's not true. Even in Windows Forms applications, you don't need to
create a 'Sub Main'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #7
Scott,
In my opinion were all who answered giving answers on different questions,
which could be read from the original question.

Therefore, there was in my opinion nothing wrong with your answer, when you
read the question as you probably did.

Therefore, I found the reply on your answer funny, because Herfried was
answering on a different explanation of the question.

I was writing something however; than I thought better that Scott does it
first, and did not sent that.

:-)

Cor

"Scott M." <No****@NoSpam.com> schreef in bericht
news:ea**************@TK2MSFTNGP10.phx.gbl...
Huh? I didn't say that you do need a Sub Main in a Windows application.
I said there is NOT an automatic Sub Main made for you in a Windows
application and that there IS in a Console application.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uf**************@TK2MSFTNGP14.phx.gbl...
"Scott M." <No****@NoSpam.com> schrieb:
There is only an "automatic" Sub Main, if you are in a Console
Application, not in Windows


That's not true. Even in Windows Forms applications, you don't need to
create a 'Sub Main'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 21 '05 #8
"Scott M." <No****@NoSpam.com> schrieb:
Huh? I didn't say that you do need a Sub Main in a Windows application.
I said there is NOT an automatic Sub Main made for you in a Windows
application and that there IS in a Console application.


It seems that we are talking about different things... I was referring to
implicitly generated 'Sub Main's too while you were referring to code added
to the visible source code by the IDE.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #9

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

Similar topics

192
by: Kwan Ting | last post by:
The_Sage, I see you've gotten yourself a twin asking for program in comp.lang.c++ . http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=45cd1b289c71c33c&rnum=1 If you the oh so mighty...
45
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
15
by: Fred Zwarts | last post by:
In C++ execution of a program starts already before execution of main(). The initialization of static variables defined outside the scope of main is performed first. I could imagine a program where...
75
by: Beni | last post by:
I have been programming in C for about a year now. It sounds silly, but I never took the time to question why a C(or C++ or Java) program execution begins only at the main(). Is it a convention or...
5
by: Seong-Kook Shin | last post by:
Hi, I'm reading Steve's "C Programming FAQs" in book version, and have two question regarding to Q11.16 ... Also, a `return' from `main' cannot be expected to work if data local to main might be...
13
by: Sokar | last post by:
I have my main function set up as int main(int argv, char *argv) so taht i can read in a variable which is passed to the program on the command line. The problem is that main calls other...
16
by: Geoff Jones | last post by:
Hi What is the closest equivalent to Main in a VB.Net form? Geoff
2
by: psuaudi | last post by:
I have a main query that I would like to call two different subqueries. In MS Access, I usually just save the two subqueries as separate queries which are then called by a third separate and main...
28
by: ravi | last post by:
Hello everybody, I am writing a small application which does some work before the user main function starts execution. I am trying to #define the main function. But the problem is that,
11
by: aarklon | last post by:
Hi all, I have heard many discussions among my colleagues that main is a user defined function or not. arguments in favour:- 1) if it is built in function it must be defined in some header...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.