By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,987 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,987 IT Pros & Developers. It's quick & easy.

can application have Multiple Main() ??

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
....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 discussion thread is closed

Replies have been disabled for this discussion.