Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running VFP app as Service
Message
De
20/03/2016 17:01:22
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01633398
Message ID:
01633399
Vues:
84
>Hi,
>
>I am looking at a product called ServiceMill that is designed to run an application as a service. I consider using it for a small VFP 9 program I have but I have some concerns. The VFP 9 program is a fairly small program that periodically checks SQL Server for new record(s) in a table. And when a new record is inserted (by another application) this VFP 9 app prints a one-page report.
>
>This VFP 9 application has a user interface part where the customer can specify the printer name where the one-page report is printed. Also, the customer can specify/set the frequency of checking for new records (e.g. 1 minute, 5 minutes, and so on).
>
>My question is, if the customer runs this VFP 9 program as a service (using this ServiceMill) how do they make changes to some of the settings? (visual interface). Would they (customer) have to stop the service, make the changes to the settings (printer name and the interval) and then run the program as service? Or can it be done "dynamically" without stopping the service?

Probably the most common way this is handled is by having two separate applications/EXEs:

- One is the "guts"/engine that runs as a service, has no UI and actually does the work (Service.exe)
- The other configures the service, is run interactively and has a UI (Config.exe)

One example is SQL Server and SSMS.

For this to work you need to have configuration settings that are accessible by both Service and Config. Could be a VFP table, text file, XML or WHY.

You may need or want to add configuration settings for the following:

- A flag that, if set, instructs Service to re-scan/re-load configuration settings
- A flag controlling whether Service is active or paused. There should also be a means (another flag?) whereby Service communicates its current status to Config, so when Config starts it knows if Service is active or paused

The Service component may be running only once per minute (say) on a timer now, but you may want the timer event to fire more often in this split model. You may want Service to scan the new flags say once per second so it is reasonably responsive to Config changes.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform