Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap the Stop Service in VFP
Message
De
07/04/2004 09:38:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
How to trap the Stop Service in VFP
Divers
Thread ID:
00892899
Message ID:
00892899
Vues:
60
Hi all,

I have a VFP executable that I registered as a Windows Service. Is there a way to trap the Windows Service Stop action from within the exe? This is a code snippet of ways that I've tried but doesn't work.
*---------------------------------
* MyService.prg
on shutdown StopService()
public oService
oService = createobject('MyServiceClass')
read events
strtofile("Stopped after read events","c:\service.log",1)
*---------------------------------
function StopService()
   strtofile("Stopped on shutdown","c:\service.log",1)
endfunc
*---------------------------------
define class MyServiceClass as session
   procedure destroy
      strtofile("Stopped at destroy method","c:\service.log",1)
   endproc
enddefine
ramil
~~ learning to stand still
Répondre
Fil
Voir

Click here to load this message in the networking platform