Jerry,
To tell you the truth, I've not done much with AcitveX controls. However, if you have an application object, you can add a property called AutoYield to it. The application object presumably has global scope so your forms should see the new AutoYield property (if you don't have an application object, use _VFP).
Again from Hacker's: (refer to the previous quote)
"In Visual FoxPro 5.0, Microsoft introduced the AutoYield property and corresponding DoEvents command to solve this problem. When you have a form with an ActiveX control, set the application's AutoYield property to .F. and process the messages received by the control by issuing DoEvents when you're ready to handle them."
>From this and the first quote, it looks like the ActiveX control will interrupt whatever VFP code is executing when it decides to issue a message, which of course could cause havoc with your code. AutoYield=.F. prevents this by making the ActiveX control wait its turn. Then when you're ready to process the message, issue a DODEVENTS.
At least that is what I infer from these two quotes.
Buy Hacker's it can be a life saver.
Jim
-----Original Message----- From: profox-admin At leafe .DO.T com [mailto:profox-admin@leafe.com]On Behalf Of Jerry Ott Sent: Friday, February 28, 2003 4:53 PM To: profox At leafe .DO.T com Subject: Re: AutoYield Property
Jim
Thanks for the info. I'm still in the dark about the quote "set the application's AutoYield to .F." A VFP form does not have an AutoYield property. Is issuing _vfp.autoyield = .f. what they are referring to? If so, where does this get inserted into the code?
TIA
Jerry, > > AutoYield is a property of _VFP added in 5.0. If you have a copy of Hacker's > (If you don't have a copy, BUY IT), there is a topic that explains how it is > used. > > Here is a quote from Hacker's: > "The challenge of working with ActiveX controls is that, at times, they seem > to have a mind of their own. When AutoYield is left at the default setting, > clicking on an ActiveX control sends that click directly to the control and > it responds with its native behavior. If your code happens to be in the > middle of doing something else, well, too bad" > > Jim > > -----Original Message----- > From: profox-admin@leafe.com [mailto:profox-admin At leafe .DO.T com]On Behalf Of > Jerry Ott > Sent: Friday, February 28, 2003 4:09 PM > To: profox@leafe.com > Subject: AutoYield Property > > > I have purchased the OCX TookBox from DBI to get at their HTML viewer. > > They tell me that AutoYield needs to be set to .f. in the load of each form > for the controls to work correctly. VFP forms do not have an AutoYield > property. Setting _vfp.autoyield = .f. doesn't seem to help. > > Anybody got any ideas? > > TIA > > Jerry
©2003 Jim McKinniss |