Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make a VFP exe become an win2k service
Message
 
 
À
22/11/2001 09:02:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00584505
Message ID:
00584929
Vues:
33
This message has been marked as the solution to the initial question of the thread.
Hi Fernando,

You don't need a loop because READ EVENTS start event processing that can be canceled only by CLEAR EVENTS. I don't think you need form eaither. Here's sample code (not tested)
Application.Visible = .F.  && There is a screen=off in config.fpw
On ShutDown CLEAR EVENTS
nMessage = 0
Do CriaObj
Read  Events
Return

* -------------------------------------------
 Procedure CriaObj
 oMailLoop = CreateObj ("MailLoop")
 EndProc && CriaObj
* -------------------------------------------
 Function SendMapiMail
 LParameters pMessage
 . . .
 EndFunc && SendMapiMail
* -------------------------------------------
 Define Class MailLoop as Timer

        Name   = "MailLoop"
        Procedure Timer
                  This.Enabled = .F.
                  nMessage = nMessage + 1
                  SendMapiMail ("This is message #" + lTrim (Transform (nMessage, "999,999")))

                  This.Interval = 20000    && 20 sec's
                  This.Enabled = .T.
        EndProc

        Procedure Init
                  This.Interval = 100   && Let it fire immidiately
                  This.Enabled = .T.
        EndProc

 EndDefine
>
>I changed prg's logic. Its works fine as below, but if I change Application.Visible to .F., it starts, appears in win2k task manager list, but does nothing.
>
>Any idea? I'm not sure about the read events loop I did, too.
>
< snip >
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform