473,407 Members | 2,359 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,407 software developers and data experts.

can application have Multiple Main() ??

Hello,

I had one doubt,please clarify it.

Main is the entry point for the application.
if i had multiple overloaded main methods in my application.
how the compiler recognizes the original Main().????

Jan 26 '07 #1
4 6169
No.
"chandu" <na*************@hotmail.comwrote in message
news:e0**************@TK2MSFTNGP05.phx.gbl...
Hello,

I had one doubt,please clarify it.

Main is the entry point for the application.
if i had multiple overloaded main methods in my application.
how the compiler recognizes the original Main().????



Jan 26 '07 #2
i got the information from MSDN, one application can have multiple main(),
but has the option to specify the entry point in application....please see
this link...

http://msdn2.microsoft.com/en-us/lib...38(vs.80).aspx
"chandu" <na*************@hotmail.comwrote in message
news:e0**************@TK2MSFTNGP05.phx.gbl...
Hello,

I had one doubt,please clarify it.

Main is the entry point for the application.
if i had multiple overloaded main methods in my application.
how the compiler recognizes the original Main().????



Jan 26 '07 #3
quotes from the specs:

<quote>
However, within a single program, no class or struct shall contain more than
one method called Main whose definition qualifies it to be used as an
application entry point. Other overloaded versions of Main are permitted,
however, provided they have more than one parameter, or their only parameter
is other than type string[].
<snip>
It is possible for more than one of these classes or structs to contain a
method called Main whose definition qualifies it to be used as an
application entry point. In such cases, one of these Main methods shall be
chosen as the entry point so that application startup can occur. This choice
of an entry point is beyond the scope of this specification
</quote>

In VS that choice can be made in the properties pane of the project.

"chandu" <na*************@hotmail.comschrieb im Newsbeitrag
news:e0**************@TK2MSFTNGP05.phx.gbl...
Hello,

I had one doubt,please clarify it.

Main is the entry point for the application.
if i had multiple overloaded main methods in my application.
how the compiler recognizes the original Main().????



Jan 26 '07 #4
....but always one entry point. A second main method but only one entry
point. I thought that was what you were asking, my apologies if i
misinterpreted your original question.
"Christof Nordiek" <cn@nospam.dewrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
quotes from the specs:

<quote>
However, within a single program, no class or struct shall contain more
than one method called Main whose definition qualifies it to be used as an
application entry point. Other overloaded versions of Main are permitted,
however, provided they have more than one parameter, or their only
parameter is other than type string[].
<snip>
It is possible for more than one of these classes or structs to contain a
method called Main whose definition qualifies it to be used as an
application entry point. In such cases, one of these Main methods shall be
chosen as the entry point so that application startup can occur. This
choice of an entry point is beyond the scope of this specification
</quote>

In VS that choice can be made in the properties pane of the project.

"chandu" <na*************@hotmail.comschrieb im Newsbeitrag
news:e0**************@TK2MSFTNGP05.phx.gbl...
>Hello,

I had one doubt,please clarify it.

Main is the entry point for the application.
if i had multiple overloaded main methods in my application.
how the compiler recognizes the original Main().????




Jan 26 '07 #5

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

Similar topics

4
by: Chuck | last post by:
Hello everybody, I need to abort execution during start up, while the constructor called by Application.Run is executing. If the database fails to connect during my application's startup I...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
10
by: Steve Taylor | last post by:
I am having trouble understanding the ASP.NET application boundaries. Here's my setup: 1. Win2003 Server with IIS 6 and an application defined at the root "SalesNow" (www.salesnow.com). 2. A...
1
by: Gordon Smith | last post by:
I plan to install multiple Web applications installed on a single Web server. Should I create each Web site in its own Application pool? I'd appreciate any recommendations, guidelines or links to...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
7
by: =?Utf-8?B?U2hpdmEgUmFtYW5p?= | last post by:
I have a windows application with multiple forms & another web application. Now I need a parent EXE or Application which need to act as a container to these application. Example : My existing Web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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
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...
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,...
0
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...

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.