473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Startup object

cj
In 2003 I sometimes changed the startup object of a project to Sub Main
which was found in Module1.vb. I upgraded one such project to 2005 and
I notice in the properties page for the project that nothing is selected
as the startup object. It appears to function but should I set it to
Sub Main?
Jan 12 '07 #1
8 3539
cj
I just noticed on projects created from scratch in 2005 the checking and
unchecking of "enable application framework" affects this. Can anyone
point me to some basic and brief info on how this relates to what I was
used to in 2003? I'm Googling now.

cj wrote:
In 2003 I sometimes changed the startup object of a project to Sub Main
which was found in Module1.vb. I upgraded one such project to 2005 and
I notice in the properties page for the project that nothing is selected
as the startup object. It appears to function but should I set it to
Sub Main?
Jan 12 '07 #2

I"m in the same boat dude.
A little too much vb.net voodoo going on.

"cj" <cj@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
I just noticed on projects created from scratch in 2005 the checking and
unchecking of "enable application framework" affects this. Can anyone
point me to some basic and brief info on how this relates to what I was
used to in 2003? I'm Googling now.

cj wrote:
In 2003 I sometimes changed the startup object of a project to Sub Main
which was found in Module1.vb. I upgraded one such project to 2005 and
I notice in the properties page for the project that nothing is selected
as the startup object. It appears to function but should I set it to
Sub Main?

Jan 12 '07 #3
cj
Deep voodoo. And it'll probably all change again in a couple of years.
They'll be promoting a new, better and very different way of doing things.
sloan wrote:
I"m in the same boat dude.
A little too much vb.net voodoo going on.

"cj" <cj@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
>I just noticed on projects created from scratch in 2005 the checking and
unchecking of "enable application framework" affects this. Can anyone
point me to some basic and brief info on how this relates to what I was
used to in 2003? I'm Googling now.

cj wrote:
>>In 2003 I sometimes changed the startup object of a project to Sub Main
which was found in Module1.vb. I upgraded one such project to 2005 and
I notice in the properties page for the project that nothing is selected
as the startup object. It appears to function but should I set it to
Sub Main?

Jan 12 '07 #4

I also checked.

C# does a nice little Program.cs thing for you:

Ahhhhh! VB.Net 2005 just took a dufous step back to vb6/vb5/vb4. I can't
speak past vb4.

using System;

using System.Collections.Generic;

using System.Windows.Forms;

namespace MyApp

{

static class Program

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fals e);

Application.Run(new MainForm());

}

}

}


"cj" <cj@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
Deep voodoo. And it'll probably all change again in a couple of years.
They'll be promoting a new, better and very different way of doing
things.
>

sloan wrote:
I"m in the same boat dude.
A little too much vb.net voodoo going on.

"cj" <cj@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
I just noticed on projects created from scratch in 2005 the checking
and
unchecking of "enable application framework" affects this. Can anyone
point me to some basic and brief info on how this relates to what I was
used to in 2003? I'm Googling now.

cj wrote:
In 2003 I sometimes changed the startup object of a project to Sub
Main
>which was found in Module1.vb. I upgraded one such project to 2005
and
>I notice in the properties page for the project that nothing is
selected
>as the startup object. It appears to function but should I set it to
Sub Main?

Jan 12 '07 #5
MS thinks WinForm applications should always start with a form.

So in VB2005, if you want to start with a static method
(Sub Main), you can do that, but MS assumes it's not going to be
a WinForm application. Just select the class name that contains
the Sub Main in the Startup Object combo box on the Application
page of the My Project designer.

For this option to be available, you have to have the
Enable Application Framework option disabled, because
that is used for Windows Forms applications.

You can enable the XP styles manually if you choose to do so.
According to Francesco Balena's "Standard Practices" book, you
should invoke Application.DoEvents right after enabling the
visual styles because there's some bug in int. They may have
fixed this in VB2005, though. He gives a link:
http://www.codeproject.com/buglist/E...lStylesBug.asp

Robin S.
------------------------------------------------------
"cj" <cj@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
>I just noticed on projects created from scratch in 2005 the checking
and unchecking of "enable application framework" affects this. Can
anyone point me to some basic and brief info on how this relates to
what I was used to in 2003? I'm Googling now.

cj wrote:
>In 2003 I sometimes changed the startup object of a project to Sub
Main which was found in Module1.vb. I upgraded one such project to
2005 and I notice in the properties page for the project that nothing
is selected as the startup object. It appears to function but should
I set it to Sub Main?

Jan 15 '07 #6
Hi Cj,

About the startup object, VS2005 is compatible with VS.NET 2003.

In VS.NET 2003, we could select a form or a module that contains Sub Main
procedure, or just Sub Main if Sub Main procedure is declared only once in
the project, as the startup object.

It's same in VS2005. In addition, VS2005 instroduce a new option of 'Enable
application framework' which specifies whether or not a Windows application
project will start with a custom Sub Main procedure (that you have
created).

If you enable the application framework, your application uses the standard
Sub Main. If you disable the application framework, your application could
use the custom Sub Main.

When a VS.NET 2003 Windows application project is upgraded to VS2005, the
startup object remains unchanged. However, the problem is that if we set
Sub Main as startup object in the VS.NET 2003 project and then upgrade it
to VS2005, the 'Startup object' option in the project designer is not set.
I have performed a test and confirmed this. I also found that if I set the
startup object to a form or a module, the form or module is set as the
startup object in the project designer in upgraded project.

I think this may be a limitation of VS2005 when upgrading projects.
Although it still functions, I suggest that you set the startup object to
Sub Main or some other things in the project designer for the upgraded
project, lest this may cause confusion for other developers.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 15 '07 #7
cj
Thanks!

RobinS wrote:
MS thinks WinForm applications should always start with a form.

So in VB2005, if you want to start with a static method
(Sub Main), you can do that, but MS assumes it's not going to be
a WinForm application. Just select the class name that contains
the Sub Main in the Startup Object combo box on the Application
page of the My Project designer.

For this option to be available, you have to have the
Enable Application Framework option disabled, because
that is used for Windows Forms applications.

You can enable the XP styles manually if you choose to do so.
According to Francesco Balena's "Standard Practices" book, you
should invoke Application.DoEvents right after enabling the
visual styles because there's some bug in int. They may have
fixed this in VB2005, though. He gives a link:
http://www.codeproject.com/buglist/E...lStylesBug.asp

Robin S.
------------------------------------------------------
"cj" <cj@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
>I just noticed on projects created from scratch in 2005 the checking
and unchecking of "enable application framework" affects this. Can
anyone point me to some basic and brief info on how this relates to
what I was used to in 2003? I'm Googling now.

cj wrote:
>>In 2003 I sometimes changed the startup object of a project to Sub
Main which was found in Module1.vb. I upgraded one such project to
2005 and I notice in the properties page for the project that nothing
is selected as the startup object. It appears to function but should
I set it to Sub Main?

Jan 15 '07 #8
cj
Thanks!

Linda Liu [MSFT] wrote:
Hi Cj,

About the startup object, VS2005 is compatible with VS.NET 2003.

In VS.NET 2003, we could select a form or a module that contains Sub Main
procedure, or just Sub Main if Sub Main procedure is declared only once in
the project, as the startup object.

It's same in VS2005. In addition, VS2005 instroduce a new option of 'Enable
application framework' which specifies whether or not a Windows application
project will start with a custom Sub Main procedure (that you have
created).

If you enable the application framework, your application uses the standard
Sub Main. If you disable the application framework, your application could
use the custom Sub Main.

When a VS.NET 2003 Windows application project is upgraded to VS2005, the
startup object remains unchanged. However, the problem is that if we set
Sub Main as startup object in the VS.NET 2003 project and then upgrade it
to VS2005, the 'Startup object' option in the project designer is not set.
I have performed a test and confirmed this. I also found that if I set the
startup object to a form or a module, the form or module is set as the
startup object in the project designer in upgraded project.

I think this may be a limitation of VS2005 when upgrading projects.
Although it still functions, I suggest that you set the startup object to
Sub Main or some other things in the project designer for the upgraded
project, lest this may cause confusion for other developers.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 15 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
11260
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus...
4
1892
by: Tony Vitonis | last post by:
Hello. I've written an app that I want to "live" in the system tray. I want it to start up with just a tray icon showing, and if the user selects "Settings..." from the icon's context menu, to...
4
3885
by: Chris Ashley | last post by:
I have a class called App set as the startup object with the following code: Friend Class App Shared Sub Main() Dim FrmMain As New MainForm Application.Run(FrmMain) End Sub End Class In...
0
973
by: mark | last post by:
Does anyone know if there is a way of having a dynamic startup object in a .NET application? I have a windows application which I would like to be able to run as a Windows Forms app or a Windows...
4
7821
by: Johnnie Miami | last post by:
I'm using VB.Net 2005 beta 2 and have my login form (login.vb) specified as the startup form. If the user is successful logging in, I call my main form (main.vb). This all works fine but the...
12
1991
by: chinkuang | last post by:
Hi Everyone: I have a question here: I used a startup object to protect my application - whenever PC starts up, I will check the setting of my application like registry, program files and so on,...
10
2970
by: Bernie Hunt | last post by:
This is probably a silly question, but I've gotten myself confused. My app has two forms, form1 and form2. form1 is the start up object in the propers. An event in form1 instantiates form2. ...
3
1569
by: steveeisen | last post by:
I'm a long-time VB6 programmer in a shop that is mostly moving to VB ..NET 2005. And I'm confused about coding the start of solutions for unattended operations. Much of what I write is old-time...
2
1558
shek124
by: shek124 | last post by:
I want to run a windows startup program. here my code: Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As Long Public Declare Function RegCreateKey Lib...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.