General information
Category:
Coding, syntax & commands
I haven't read this tip (I think I'm late with one issue of FoxPro Advisor). I think this tip should work fine in VFP3. In VFP5, the Timer event will be fired for 50-300 (depending on how powerful and loaded is the computer) until it is disabled even if you have (This.Enabled = .f. in the Timer event).
The fix to this problem in VFP5: replace This.Enabled = .f. with Release This. This is the only way to realy stop a Timer with a very short interval in VFP5.
Vlad
>Markus Egger just had a tip in FoxPro Advisor on this. The problem is in the event model of VFP. An internal flag is set whenever a OLE event occurs. ALL other events are ignored until the first is over. Markus suggest a timer class to circumvent the problem. I hope it's ok to reproduce here.
>
>DEFINE CLASS cCommandTimer AS timer
> Enabled=.F.
> Interval=1
> Name='cCommandTimer'
> cCommand=SPACE(0)
>
>PROCEDURE DoCommand
> LPARAMETERS lcCommand
> THIS.cCommand=lcCommand
> THIS.Enabled=.T.
> RETURN
>ENDPROC
>
>PROCEDURE Timer
> THIS.Enabled=.F.
> LOCAL lcCommand
> lcCommand=THIS.cCommand
> &lcCommand
> RETURN .T.
>ENDPROC
>ENDDEFINE
>
>The DO FORM is fired 'late' by the TIMER.DoCommand 'DO FORM
>This discusion in his tip article is more complete.
>Thanks Makus - I had just run into this puzzling problem:))))
>HTH
>
>
>>Look in Help/doc at AutoYield and DoEvents.
>>
>>Vlad
>>
>>>Did anyone already try to open a modal Form from a method within an OLE-Container containing an ActiveX-Control.
>>>
>>>I have such a constellation. A DO FORM command is issued from a method like CLICK or RIGHTCLICK. The method in question fires from within an ActiveX-Control like LISTVIEW or TREEVIEW. If the thus called Form is modal and that modal form itself contains an other ActiveX-Control like one of the upper ones, those ActiveX-Controls do not react on any event.
>>>
>>>Suggestions?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only