Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Boudewijn Lutgerink
 To: Tom Young
  Where is Tom Young?
 Connecticut - United States
 Tom Young
Subject: RE: Timer suspends during OLE execution
Thread ID: 113712 Message ID: 113776 # Views: 31 # Ratings: 1
Version: Visual FoxPro 6 Category: Active X Controls & OLE Automation
Date: Wednesday, November 22, 2006 9:06:06 AM         

> I've written a program that controls pcAnywhere (version 12) sessions through OLE automation. I have everything working fine except that occasionally the AWREM32.EXE module will freeze up when the dialed host does not respond correctly.
> To fix this problem, I created a "watchdog" timer object to monitor the process every second (interval=1000). The intent is to kill the AWREM32 process if it doesn't finish within 10 minutes. I'm sure this would be working great except I have found out that the timer's event trigger is totally suspended during the OLE call. When the OLE function completes, the timer will "batch" all the deferred events and fire them rapidly in succession. For example, the timer's interval is 1000 (1 second). If an OLE function takes 57 seconds, the timer is suspended for that period and then rapidly fires 57 times immediately upon the return from OLE function.
> Anyone have knowledge/solution on this problem??? Thanks VERY much...

The same problem occurs when you have a timer running in some app and then open a modal window, like the table designer.
I found this out some years ago. What I did was I downloaded the cpptimer from www.bbcontrols.com. This code gives you a timer that will keep on running, no matter what other processes are currently active.

There are some samples included in the package and the best yet, it is free of charge.

Boudewijn LutgeĀ®ink
The attitude of "An eye for an eye and a tooth for a tooth" will make this world toothless and blind (Ghandi)


Timer suspends during OLE execution Posted by Tom Young @ 11/21/2006 6:33:06 PM
RE: Timer suspends during OLE execution Posted by Boudewijn Lutgerink @ 11/22/2006 9:06:06 AM
RE: Timer suspends during OLE execution Posted by Tom Young @ 12/3/2006 11:33:32 PM