Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to exit WaitForSingleObject?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00844020
Message ID:
00844255
Views:
27
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform