Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Starting Modal Form from ActiveX-Method
Message
From
18/10/1997 20:48:17
 
 
To
18/10/1997 13:18:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00055284
Message ID:
00055301
Views:
29
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
Map
View

Click here to load this message in the networking platform