473,769 Members | 5,449 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 3565
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.nosp amwrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
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.nosp amwrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
>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.Collecti ons.Generic;

using System.Windows. Forms;

namespace MyApp

{

static class Program

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main()

{

Application.Ena bleVisualStyles ();

Application.Set CompatibleTextR enderingDefault (false);

Application.Run (new MainForm());

}

}

}


"cj" <cj@nospam.nosp amwrote in message
news:%2******** **********@TK2M SFTNGP03.phx.gb l...
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.nosp amwrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
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.DoE vents 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.nosp amwrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
>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.DoE vents 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.nosp amwrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
>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
11321
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 Allow Toolbar/Menu Changes Use Access Special Keys
4
1907
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 display a window that will allow him to change settings. When he hits "OK" or "Cancel", the window should hide again. At first, I tried putting a "Me.Visible = False" in the form's Load event, but apparently that code runs before the command can...
4
3908
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 another form I use the following code:
0
985
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 service - is this possible? When I set the startup object to the Service, the service starts correctly, but I cannot then run it as a Windows Forms application. If I set the startup object to a form, the Forms application runs, but I cannot...
4
7852
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 problem is that the login form stays open. I put a me.close (in the login form) after opening the main form but that seems to close everything and the main form is not displayed. I thought I could call a Sub Main() that calls the login form, closes...
12
2029
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, if they have been tampered then I will restore the original settings from the backup files I store in some hidden place. However now a guy said he has a tool that able to modify the Windows XP registry without even login to window - that means...
10
3002
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. Dim myForm as HardwareStore myForm = New HardwareStore myForm.Show() I understand that my form2 can be referenced by
3
1587
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 batch. Such programs are started from a scheduler and run on a server, cycling through a mass of data, without human intervention. No form should show on the server monitor, although an invisible one may be needed to support the Winsock or...
2
1584
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 "advapi32.dll" Alias "RegCreateKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, ByVal phkResult As Long) As Long Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String) As Long...
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
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 we have to send another system
3
2815
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.