Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing an app stops a service
Message
De
04/10/2007 15:47:18
 
 
À
04/10/2007 15:38:52
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01258680
Message ID:
01258699
Vues:
11
>>>Limited information on the code other than to say that I have a project called EMPS_Admin that uses a form to read/update registry key values and start/stop a service called EMPS. Funny thing is that when I quit/cancel EMPS_Admin, it kills the EMPS service. There is no code on shutdown that should affect the EMPS service. Any thoughts? I'll post code if anyone wants to see it, but there's a bunch and as much as I can tell, it's not code-specific as much as it is simply that when the EMPS_Admin closes, so does the EMPS service that's running. I'm using Shell.Execute.StopService and StartService and IsServiceRunning to handle the EMPS service, but nothing runs on shutdown except CLEAR READ.
>>
>>Have you stepped through _Admin in the debugger to make sure that nothing is actually being called on shutdown?
>>
>>Could _Admin be setting or modifying any kind of flag (inadvertently or on purpose) that the service may be treating as a signal to shut itself down?
>
>Great advice and I was doing that probably as you were typing your post.
>
>This is the strange thing; I found the problem, but have no idea why.
>
>This line of code is causing the service to start:
>
>
>IF m.THISFORM.oShellApp.ServiceStop(.ServiceName, .F.) AND Toggle
>
>
>When all I thought it was supposed to do is try to stop it if it was running. The ServiceStart also starts the service if it is not running. Not sure I understand that.

I don't know the syntax of the function call, or what "Toggle" means. All that jumps out at me is that you say "This line of code is causing the service to start:", then the code issues a call named .ServiceStop( ... ) Is this a typo?
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