Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Autoyield and Event firing
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00066743
Message ID:
00066933
Views:
35
>I have an ActiveX object on my form that continually updates certain info on my form. It seems to work fine until I click a button on my form to send out a message and wait for a response. While I am in a do loop, it does not get any of the ActiveX events. It doesn't even buffer them. I found the AutoYield property. From what it says I would think that with _VFP.AutoYield = .t. it should let the ActiveX control fire its events, but it doesn't. The same code in VB seems to fire the ActiveX events, but I would like to not have to try to use the Database functions in VB if possible.
>Does anyone know anything about this? Does the AutoYeild property set to .t. not work quite the way it is documented?
>
>TIA
>Bill
Bill,

When VFP is running code in the foreground it does not process windows messages until it finishes the code that is running. Your loop is preventing any of the windows messages from getting into VFP. You need a DOEVENTS command somewhere inside your loop to tell VFP to pause a moment and process the windows events.

You should be aware that a DOEVENTS can seriously slow down VFP because it has to process all windows events and all of its own events before the code can continue. Therefore, if your loop is doing more than just waiting for a response you may want to use a counter and only issue the DOEVENTS every x times through the loop.
Previous
Reply
Map
View

Click here to load this message in the networking platform