473,558 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What's the Best Startup Scenario for Unattended Server Execution?

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 other
control.

In VB6, I usually have a Main routine in a standard module as the
startup. But in a VB 2005 Windows Application, the startup has to be a
form, even if you don't have any intrinsic need for one.

I briefly looked into console applications, but never need a DOS-type
window. And console applications seem out of the question because they
require giving up ApplicationEven ts.

Code like this does work to turn a Windows Application into what I am
used to:

Public Class MyUselessForm
Private Sub MyUselessForm_L oad(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles MyBase.Load
Main()
End Sub
Sub Main()
' do the real processing starting from here
End
End Sub
End Class

However, there must be something slicker. Before I start using the
above many times, does someone have a better idea? And, no, going back
to COBOL won't be better :-)

Steve Eisenberg Pennsylvania U.S.A.

Jun 14 '06 #1
3 1576
CT
Steve,

You don't actually have to set a Form in a Windows application to be the
startup object. In the properties for a project, you can set the startup
object to be Sub Main and place that in a Module. In VS 2005, you need to
clear the Enable application framework checkbox to select Sub Main in the
Startup object list.

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn't work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
<st********@yah oo.com> wrote in message
news:11******** *************@i 40g2000cwc.goog legroups.com...
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 other
control.

In VB6, I usually have a Main routine in a standard module as the
startup. But in a VB 2005 Windows Application, the startup has to be a
form, even if you don't have any intrinsic need for one.

I briefly looked into console applications, but never need a DOS-type
window. And console applications seem out of the question because they
require giving up ApplicationEven ts.

Code like this does work to turn a Windows Application into what I am
used to:

Public Class MyUselessForm
Private Sub MyUselessForm_L oad(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles MyBase.Load
Main()
End Sub
Sub Main()
' do the real processing starting from here
End
End Sub
End Class

However, there must be something slicker. Before I start using the
above many times, does someone have a better idea? And, no, going back
to COBOL won't be better :-)

Steve Eisenberg Pennsylvania U.S.A.

Jun 15 '06 #2
Steve,

In addition to Carsten, Jay has somewhere in this newsgroup once showed all
the possibilities to start-up a VBNet application. It are definitely more
than that "one" in Cobol (I thought eleven).

Be aware that although Carsten writes it completely correct, we probably all
had problems finding that the first time for version 2005 (it is easier in
2002/2003), so don't hesitate to reply if you do not find it or that it does
not work.

:-)

Cor

<st********@yah oo.com> schreef in bericht
news:11******** *************@i 40g2000cwc.goog legroups.com...
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 other
control.

In VB6, I usually have a Main routine in a standard module as the
startup. But in a VB 2005 Windows Application, the startup has to be a
form, even if you don't have any intrinsic need for one.

I briefly looked into console applications, but never need a DOS-type
window. And console applications seem out of the question because they
require giving up ApplicationEven ts.

Code like this does work to turn a Windows Application into what I am
used to:

Public Class MyUselessForm
Private Sub MyUselessForm_L oad(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles MyBase.Load
Main()
End Sub
Sub Main()
' do the real processing starting from here
End
End Sub
End Class

However, there must be something slicker. Before I start using the
above many times, does someone have a better idea? And, no, going back
to COBOL won't be better :-)

Steve Eisenberg Pennsylvania U.S.A.

Jun 15 '06 #3
Cor Ligthert [MVP] wrote:
In addition to Carsten, Jay has somewhere in this newsgroup once showed all
the possibilities to start-up a VBNet application.


My Googling skills failed in trying to find that. The OP question is
one I do find asked a few times before, but it never has quite been
given the slick answer I thought might be possible.

I thank Carsten for his method, but it loses the ApplicationEven ts. If
you are used to going without them, that's no problem, but as soon as I
saw that feature, I wanted it.

I now have an alternate method that is maybe just slightly less clunky
than the one in the OP, but it still requires having a non-functioning
form. In the Startup ApplicationEven t, I launch a procedure which is
the starting point for the true application, like this:

Private Sub MyApplication_S tartup(ByVal sender As Object, _
ByVal e As _
Microsoft.Visua lBasic.Applicat ionServices.Sta rtupEventArgs) _
Handles Me.Startup
StartupProc()
End Sub

StartupProc in this example is a Friend Sub in a standard module. By
the way, what I call StartUpProc cannot be called Main. Just about
anything else is fine.

Then, in the Load routine of the otherwise unused form, I have this:

Me.Close()

In this scheme, all the processing is acutally occurring during the
Startup event, and the startup form never finishes loading. Thinking
there could be a problem getting to other applications events when you
were still technically in the Startup ApplicationEven t, I tested
StartupNextInst ance and UnhandledExcept ion successfully. I assume that
NetworkAvailabi lityChanged will work as well. So there is no
functional or maintainability problem, just that it doesn't seem right
for someone looking at your code to see a form requiring an
explanation.

Thanks for all ideas, or for pointing out something obvious that I'm
missing.

Steve Eisenberg Pennsylvania, U.S.A.

Jun 16 '06 #4

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

Similar topics

6
16929
by: Ken Varn | last post by:
Sometimes when I try to close my managed C++ application, the following dialog displays in Win 2000 Pro: The title of the dialog is "Server Busy". The message is "This action cannot be completed because the other program is busy. Choose 'Switch to' to activate the busy program and correct the problem." I don't know why this is...
3
1199
by: Stan | last post by:
I am looking for the best solution for this scenario: ASP.NET needs display an editable form with 20 textboxes. Data source is xml. Xml must be updated. if user clicks Update button on the form. Scenario 1 - brute force Load xml into XmlDocument, txtName.Text = doc.SelectSingleNode ('\\bla\@bla").Value
10
1307
by: Steve Franks | last post by:
Hi all, I've spent the past several months developing my ASP.NET 2.0 web site using Beta 2, and its working great. Even though 2.0 beta 2 has a Go Live license, I have not deployed to production yet. It is a brand new web site so I want to wait and just deploy with the final release of 2.0 now that it is coming in just a couple weeks.
8
26782
by: Brian Fulford | last post by:
This is my first shot at a Winforms application in dot net. This application is mainly going to run unattended but is using a form to display current activity of the background processing. In VB6, I could set the startup to be Sub Main and then call frmMain.Show and the program would continue processing; however, after instantiating the from...
7
1914
by: ÀÏÆÅ»³ÔÐ5¸öÔ | last post by:
I want use dropdownlist contral in gridview but have trouble now mycode here: i'm very sorry for my poor english <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
1596
by: Bjarne | last post by:
Dear all, although being a user of PHP and other scripting-languages for years, I have not taken part in any large projects based on PHP. Thus, I don't really know how real PHP-applications are deployed out there. This posting is a request for input from professional PHP-users and architects with experience from designing PHP applications. ...
10
18051
by: kimiraikkonen | last post by:
Hi there, I figured out, for the first execution for any .NET-powered app such as VB.NET or C#, it takes 7-8 seconds to see main form of "any" application even the application consists of a single form and a button and only 32kb sized. The second execution(without rebooting machine) is done less than a second. This slowdown on startup...
2
2706
by: sp | last post by:
I am looking for a files .net 1.1 .net 2.0 .net 3.0 that can I integrate with Windows XP installation CD for unattended install. I am looking for an patches for it also.
3
1778
by: Dean Slindee | last post by:
Need to write a standalone application that processes data once per day. Looking for the application program types available that would satisfy these requirements: Requirements: 1. Unattended processing that looks for rows in tables in a SQL Server database that is updated in batch once per day via another company's daily process. The newly...
0
7629
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...
0
8061
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...
0
7914
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...
0
6183
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5455
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1164
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
869
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...

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.