Different Entry Point

J

Jon Slaughter

Is is possible to define a different entry point than Main?


i.e.
[STAThread]

static void MainEntryPoint()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new MainForm());

}



Or is it hard coded so you have to use Main?

(BTW, I'm in VS.net)



Thanks,

Jon
 
D

Dave Sexton

Hi Jon,

You can change the startup object in the properties window for your project, however I don't think you can change the method name
from Main.

What are you trying to accomplish by changing the Main method's name?
 
J

Jon Slaughter

Dave Sexton said:
Hi Jon,

You can change the startup object in the properties window for your
project, however I don't think you can change the method name from Main.

What are you trying to accomplish by changing the Main method's name?

I just wanted to call my class main instead of program ;/ Not a big deal but
was just curious if I could.
 
J

Jon Skeet [C# MVP]

Jon said:
I just wanted to call my class main instead of program ;/ Not a big deal but
was just curious if I could.

I've taken to calling the entry point class EntryPoint which then
doesn't conflict with Main. Just an idea :)

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top