HighTechTalks DotNet Forums  

Sub Main Procedure Missing???

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Sub Main Procedure Missing??? in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Neo
 
Posts: n/a

Default Sub Main Procedure Missing??? - 01-24-2006 , 11:51 AM






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....
Thanks

Reply With Quote
  #2  
Old   
pvdg42
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-24-2006 , 12:13 PM







"Neo" <Neo (AT) discussions (DOT) microsoft.com> wrote

Quote:
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....
Thanks
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.




Reply With Quote
  #3  
Old   
Neo
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-24-2006 , 02:18 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

"pvdg42" wrote:

Quote:
"Neo" <Neo (AT) discussions (DOT) microsoft.com> wrote in message
news:057FFC1A-1022-4047-ADA9-C4D63194F877 (AT) microsoft (DOT) com...
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....
Thanks

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.




Reply With Quote
  #4  
Old   
pvdg42
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-24-2006 , 04:06 PM




"Neo" <Neo (AT) discussions (DOT) microsoft.com> wrote

Quote:
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

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"?




Reply With Quote
  #5  
Old   
Neo
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-25-2006 , 07:06 AM



I shall do that right now. .. . .

"pvdg42" wrote:

Quote:
"Neo" <Neo (AT) discussions (DOT) microsoft.com> wrote in message
news:F9888655-6609-4F06-B0B1-1E3E6E6B8DAB (AT) microsoft (DOT) com...
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

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"?




Reply With Quote
  #6  
Old   
Neo
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-25-2006 , 07:10 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

"pvdg42" wrote:

Quote:
"Neo" <Neo (AT) discussions (DOT) microsoft.com> wrote in message
news:F9888655-6609-4F06-B0B1-1E3E6E6B8DAB (AT) microsoft (DOT) com...
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

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"?




Reply With Quote
  #7  
Old   
AT
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-25-2006 , 09:31 AM



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
object' to the new name.

Reply With Quote
  #8  
Old   
Neo
 
Posts: n/a

Default Re: Sub Main Procedure Missing??? - 01-25-2006 , 09:52 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.

"newto (AT) false (DOT) com" wrote:

Quote:
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
object' to the new name.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.