473,670 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2119
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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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******** ******@TK2MSFTN GP14.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******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP14.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
8895
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 programmer that you pretend to be, why don't you just write some? (And oh, void main is still not allow by the C++ standard.) Seeming as how you tried to quote the standard in an attempt to pretend you're right, I'll quote the standard to once...
45
3595
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 themselves are an exception to this), and 'bootstrap' your program by instantiating a single application object in main(), would that place any limitations on what you could accomplish with your program? Are there any benefits to doing things that...
15
2877
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 the whole job can be done in the constructor and destructor of a static variable. (Wouldn't that be the ultimate OOP program, just the creation and deletion of an object?) Does the C++ standard require to have a (dummy) main() function in such...
75
9852
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 is there some deeper underlying reason?
5
2801
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 needed during cleanup. (Finally the two forms are obviously not equivalent in a recursive call to `main'). My questions are
13
7765
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 functions and some of them need to start jump to the start of main. If my main setup was just int main() this would be no problem, i could just call main(); The problem is main needs parameters passed to it now. Would any1
16
2122
by: Geoff Jones | last post by:
Hi What is the closest equivalent to Main in a VB.Net form? Geoff
2
2667
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 query. However, I'd like to put them all into one SQL command. Is this possible? Here are the queries: -This query calls the other two queries below- SELECT ., ., Format(((.Date)-(.Date)),"Fixed") AS , .Type FROM INNER JOIN ON (. = .) AND...
28
6030
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
3562
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 file but it is n't.
0
8384
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8813
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8591
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8659
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.