Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running VFP app as Service
Message
 
 
To
20/03/2016 17:01:22
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01633398
Message ID:
01633401
Views:
54
>>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.

Hi Al,

Thank you for the message. Your approach seems to be workable but maybe prone to possible issues. I am also concerned that running the app as Service, using a 3P product, may not be most reliable.

But since I posted this message I thought of another approach (I will ask the question in a .NET forum). But just in case you don't read .NET, here is what I am thinking. The new records are added to the SQL server from a ASP.NET application (my application). So I am thinking of (if possible), on every addition of a record run the VFP 9 application that prints the one-page form. Something like in VFP you do RUN blabla, there has to be a way to run VFP application from .NET too. I will Google first and if I don't find a suitable answer will ask here.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform