473,324 Members | 2,248 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,324 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 2099
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.