[dba-VB] VB.Net - Hook an open program

DWUTKA at marlow.com DWUTKA at marlow.com
Tue Aug 23 11:35:19 CDT 2005


Why fire a timer over and over, to check things.  Look up SetWaitableTimer.
It's one of a few API's where you can set a 'fire and forget' timer.  The OS
will just alert you when the time is reached for something to run.

Drew

-----Original Message-----
From: John W. Colby [mailto:jwcolby at colbyconsulting.com]
Sent: Tuesday, August 23, 2005 8:59 AM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] VB.Net - Hook an open program


Yes, that is the gist of it.  I have a functioning service that ATM just
fires a timer every N seconds.  I am developing another program that loads
the table of events needing to be run into classes.  Originally this program
will have a form with a timer that causes the events to be examined to see
if it is time to run one of them.  I load each event from the table into a
class simply so that I can not hit the disk every timer tick.  So this
program watches the events in the loaded class instances.  When it is time
to run, it will open a program and feed it command line parameters.  

ATM the program being opened is an Access program that sends the reports out
to the client Insurance company.  Access will open, send the reports, log
them sent, mark the records as sent and shut back down.

I was (am still) doing all of this in Access, but I want a service to run to
do the trigger part.  I will in fact eventually port this whole thing into
VB.Net.  This is a perfect application of .Net since the process is really
pulling data, building CSV and "fixed width" TXT files with specific names
in specific locations on the disk, then attaching them to emails and / or
FTPing the files out to the client Insurance company.  

Access handles this OK but since the Access GUI isn't needed at all, having
it all in VB.Net really just makes sense - assuming that I can get the Email
and FTP parts happening.  It turns out that .Net does not have that stuff
built in yet, you have to find and learn third party code, not to mention
things like how SMPT works etc.  Outlook "just did it" for me for that part.

Anyway, I am working on the port for this stuff, working from the service
outwards.  I really think I will keep an "interface" in the system, where
the scheduler is (eventually, once debugged) embedded right in the service,
and the reporting code is a standalone program just opened by the scheduler.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of DWUTKA at marlow.com
Sent: Tuesday, August 23, 2005 9:06 AM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] VB.Net - Hook an open program


Let me see if I understand what you are talking about.  You have a Service
that is really going to be the 'scheduler', because it is going to run the
tasks (from the database) when you need them.  However, you want to create a
GUI to interact with that service (which you are probably running under
specific credentials, so it can't interact with the desktop.)

If that is the case, again, Winsocks.

Drew

-----Original Message-----
From: John W. Colby [mailto:jwcolby at colbyconsulting.com]
Sent: Monday, August 22, 2005 10:06 PM
To: dba-vb at databaseadvisors.com
Subject: [dba-VB] VB.Net - Hook an open program


I want to load an application that loads scheduled tasks into classes from a
database.  Once the tasks are loaded I want my service to call this
application and ask it to run any tasks that the scheduler deems ready to
run.  Is it possible for one program to call another open (running) program?
I would like the scheduler to be part of the service but until the system is
debugged I want the scheduler to be a program with a user interface that I
can watch.  For this reason, the service would cause the scheduler to load,
and then periodically "call" the scheduler and ask it to check its list of
tasks and run any as appropriate.  Is this possible?

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com



More information about the dba-VB mailing list