Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to exit WaitForSingleObject?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00844020
Message ID:
00844255
Vues:
28
This message has been marked as a message which has helped to the initial question of the thread.
Hi Rod,

You can't wait indefinitely. Instead you need to wait for a reasonable time (500ms to 3 sec), perform a DOEVENTS and continue to wait. This gives VFP time to process Windows message. Something like this:
Do While not glQuit
  If WaitForSingleObject(m.lnHandle,500) == WAIT_OBJECT_0
    * do something
  Endif
  DoEvents
Enddo
Set glQuit in the ON SHUTDOWN procedure. If your application needs to accept input, you should rather use MsgWaitForMultipleObjects(). Be aware that DOEVENTS isn't available in DLL servers.

--
Christof
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform