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:
00067139
Views:
30
>>>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
>>
>>You're right, but it's the reverse! You should have _VFP.autoyield = .F. for your ActiveX control. (default value is .T.) I have found (with the help of other persons of the UT) that for ActiveX controls that receive focus, the easiest method is to set AutoYield to .F. in their GotFocus() event and reset it to .T. in the lost focus. For controls that don't receive focus, you'll need to set up a property at the application level that would count the number of ActiveX controls running and set the AutoYield property accordingly.
>>
>>
>>José
>This particular aplication will have only 1 ActiveX object. It will never get focus. It is set up, with its VB exe counterpart, to be a link between my app and remote hardware. I want it to keep track (every .25s) of the status of the remote hardware, even when my app sends a message through the ActiveX object to the hardware and waits for a response. My problem isn't that the ActiveX control interupts my app, it is that when I wait for a response, the ActiveX object does not keep track of the status.
>
>What is the best way to make this work? You mentioned an app property. How would that work?
>
>Thanks
>
>Bill

Bill,

Most of us use an application object. If you add a property to it, you'll be able to access it from within your app like this:
goApp.nActiveXCounter = goApp.nActiveXCounter + 1

This is somewhat comparable to a public property in old Fox. But it is far more powerfull because you can add objects too.

José
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform