all groups > dotnet academic > january 2006 >
You're in the

dotnet academic

group:

Sub Main Procedure Missing???


Sub Main Procedure Missing??? Neo
1/24/2006 9:51:20 AM
dotnet academic:
Hi I'm trying to create an application with a second form. I have already
added this form sucessfully and everything on the form works fine. But when
Trying to complie the program I get an Error Stating :

Missing Shared Sub Main Procedure....There is no Valid Sub Main Procedure...

I have tried adding the procedure just about everywhere i the second form
code, but it still says it is missing.
Does anyone know what code I should add to Get rid of this error??
I though VB.Net added this procedure automatically....
Re: Sub Main Procedure Missing??? pvdg42
1/24/2006 12:13:06 PM

[quoted text, click to view]

What edition/version of Visual Studio or Visual Basic are you using?
I tried reproducing your situation in both Visual Studio .NET 2003
Professional and in Visual Studio 2005 Professional. No error with multiple
forms.

Re: Sub Main Procedure Missing??? Neo
1/24/2006 12:18:21 PM
Yeah the version I'm running is:
Microsoft Visual Basic .NET 7.1.3

I think I found out what cause the problem but I really don't know how to
fix it.
I'm still getting the same error message which could possibly be coming from
the fact that I renamed my Form. I did this on the main form and the same
error message specific for 'FORM 1' Came up. I renamed both back to the
default names but I'm still getting that same error for form2! I searched for
this procedure in the Windows Generated code, but it is no where to be found.
Stumped!
I'm too far into the application (2 1/5) weeks, create a new form. So if you
have any ideas let me know...
Thanks

[quoted text, click to view]
Re: Sub Main Procedure Missing??? pvdg42
1/24/2006 4:06:42 PM

[quoted text, click to view]
If you renamed that form after you'd created other project components and/or
writing code yourself, that will cause problems.
Have you searched through all the code in the project, especially any
generated code, to find and correct all references to "Form1"?

Re: Sub Main Procedure Missing??? Neo
1/25/2006 5:06:03 AM
I shall do that right now. .. . .

[quoted text, click to view]
Re: Sub Main Procedure Missing??? Neo
1/25/2006 5:10:02 AM
Most of the references changed automatically. There was only only that I had
to change.. If this isn't causing my application to crash (only the initial
build error), i wonder if it will even impact it at all when I make it an
executable?
She's Gone b'ye

[quoted text, click to view]
Re: Sub Main Procedure Missing??? Neo
1/25/2006 7:52:06 AM
Ok so I change the startup object. But now I still get the error:
(shared sub main missing), and the new form won't pop up. The prgm just
crashes
Weird.

[quoted text, click to view]
Re: Sub Main Procedure Missing??? newto NO[at]SPAM false.com
1/25/2006 3:31:58 PM
In solution explorer right click on the project name, select 'properties'
from the drop down list.

From within the 'Property Pages' window which opens change the 'startup
AddThis Social Bookmark Button