Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to run VFP as a background service
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00571951
Message ID:
00571988
Vues:
41
Hi!

Of course, service runs on the system level and starts as soon as Windows NT system is loaded.

In your case, if you make this service for user just when main VFP application runs, you do not need to make it as a service. Just make it hidden. In the config.fpw file put a line "SCREEN=OFF" and include this config.FPW into the EXE - now such VFP EXE will never show main screen until you explicitly say it so.

Well, if you need it on the system level...

If your application is not data-critical, you can use SRVAny.EXE tool from the Windows NT Resource Kit. This tool allow to run ANY application (include VFP) as a usual service. Read a help file for this tool accurately - it contains some warnings. In particular, service is stopped by "killing" the application (analogue of the "End Process" button in Task Manager, but without any asking for confirmation and without any attempt to close app by normal way). That is why your app should not do anything critical that oculd spoil data or somthing else when killed at the moment it works.

For more reliability it is better to write a C++ wrapper service that will call your VFP program as a VFP COM object. In such case C++ service shuold organize timer.

Well, if your timer work is work done once/minute or it runs with greater period, it is MUCH more simple and reliable to use Windows Scheduler service.

HTH.

>I have a form with a timer that fires every 1/2 seconds to poll from a time clock. This form must stay open in order for the clock to function. Periodically a user may close this form by accident, which causes the clock not to function. Can you think of a better way to do this? I would like to do it as a background service, but can I have a timer in a service? If so, how? Any suggestions would be greatly appreciated.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform