PDA

View Full Version : I keep getting errors


AlphaAddict
10-26-2005, 10:17 AM
Can someone take a look at this (http://www.alphaaddict.myprofitshosting.com/AlphaAddict/SharpDevelop/TaskbarControls.cs) i cant compile it i keep getting errors
can someone try to get it working

nikkiH
10-26-2005, 03:09 PM
Wow. Do you take your car to the mechanic and tell him/her:
"It's broke. Fix it."

:D

Need to know what error(s) you get, what you want to happen, what actually happens (or doesn't happen, as the case may be), etc.
Last I checked, no one here was psychic. ;)

AlphaAddict
10-26-2005, 05:25 PM
ive tried on reams of forums to fix this
EVERY time i go to a win forums project and compile i get this error

http://tinypic.com/evaz4h.jpg


some people say its the main method tried it last night and reams more came up can you take a look at the project above and tell me whats wrong?
this happens in every forums project even blank ones with 1 button

please i have hundreds of people waiting for this
ill promote this site in the readme if helped
thanks in advance

nikkiH
10-26-2005, 06:17 PM
Nothing wrong in the CS file.
The actual program itself (exe) has to have an entry point. Not necessarily "main", just a point at which execution should begin. There's nothing in that CS file that sets that. It would be in the main calling code.

I've not used Windows Forms (only web forms) in .net, but in VB6 I had to set which Form was the Main Form so it knew where to begin. I think it was a property (it's been awhile). Either the Form or the Project, I don't recall.
Did you do something like that?

AlphaAddict
10-26-2005, 06:26 PM
i use sharp develop i made my app in a win forums project hit compile and got that error.
Where do i enter this exacution point ?and what do i enter ?
I could convert to vb.net format if you want...

:confused: im so new to programing but this is as advanced as i will need to get

oracleguy
10-26-2005, 07:02 PM
You don't seem to have a main() function which is used as the entry point to start the application. That is what it is looking for.

So like add the code below inside your Form1 class.


static void Main()
{
Application.Run(new Form1());
}

nikkiH
10-26-2005, 08:22 PM
I'm new to C#, too, so I'd like to know...

In java, that would have to be
public static void main

Not in C#?
Is it by default public?

tsclan
10-26-2005, 08:29 PM
May I add a simple question?
This looks like Java - is it Java?
If it is Java why is it in a cs file and not a java file?
Thanks

TheShaner
10-26-2005, 08:37 PM
It's not Java. It's C#.

-Shane

oracleguy
10-26-2005, 09:39 PM
I'm new to C#, too, so I'd like to know...

In java, that would have to be
public static void main

Not in C#?
Is it by default public?

I've never had to make it public, I don't think you have too. In GUI programs you mostly just use it to start the first form via the Application object. And yes, this is C# and not Java.

nikkiH
10-26-2005, 10:07 PM
Sorry if I confused people.
I know Java for web apps (JSP). I don't know C# all that well yet, but made some basic web forms apps. I don't know either one for plain Windows GUI stuff (any windows GUI I have coded has been as an HTA or WSH app). I like learning new things.

I learn new stuff by relating it to stuff I already know. :D

Yes, this is C#: I was asking about visibility of method behavior for C# windows forms apps specifically, as opposed to Java or web forms.
Thanks OracleGuy.

oracleguy
10-27-2005, 02:08 AM
Yeah, I'm pretty sure since main() is a special function you don't need to make it public but definetly needs to be static since it is inside a class and it has to be called before any class has been instantiated.

AlphaAddict
10-27-2005, 07:24 PM
You don't seem to have a main() function which is used as the entry point to start the application. That is what it is looking for.

So like add the code below inside your Form1 class.


static void Main()
{
Application.Run(new Form1());
}


great can you show me exactly where to insert (im so new to programing :confused: )

oracleguy
10-28-2005, 11:53 PM
Put it right above this line:
#region Windows Forms Designer generated code

AlphaAddict
10-29-2005, 06:14 PM
great
Im going to have to tell the # develop boys it dosnt work in 4074 and up

oracleguy
10-29-2005, 09:05 PM
So... did that fix it?