Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Build a Service (EXE) with VFP6?
Message
De
05/09/2000 10:00:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00411977
Message ID:
00412447
Vues:
22
>It's possible to create a Service (EXE) -which is a Windows NT application that runs in the background when NT starts up- with VFP6?

Install the NT Resource Kit. It includes two programs (InstSrv and SrvAny). From the command line setup a new service. For example:

instsrv YOURSERVICENAME srvany.exe

Note the format:
[install server program (with path)] [name of your service] [srvany (with path)]

Once that's done you need to modify some registry settings. Start up RegEdit and find your new service(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services). Now you need to enter a new key for your service called "Parameters". In the Parameters key add the the following string values:

AppDirectory = "C:\...INSERTYOURPATHHERE..."
Application = "C:\...INSERTYOURPATHHERE...\...YOUREXE.EXE"
AppParameters = "ANY PARAMETERS YOU WANT TO PASS"

Next, shut down RegEdit, open the "Services" Control Panel and look for your service. Set your service to manual or automatic and start it.

Not sure if this is the easiest way but it does work. The SrvAny and registry stuff should be easy enough to script in InstallShield. InstallShield also includes a sample install for an NT service. I've never used it though.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform