-
March 18th, 2007, 11:36 AM
#1
Global Timer Class with Events?
I am new to COM programming. Is it possible to construct a timer that can used globally, instead of just one form?
I have an app at factory which is reading in temperatures, tach rates, etc.
I would like to get timer that works on all forms.
Using label change events, I would like to alert the Global timer that a certain threshold has been surpassed by examining the value of the label.caption. I would then like to pass the control name as an argument to the Global timer. The timer will then turn the control's visible property on/off at 1-sec intervals to better alert the operator.
Is there a way upgrade the existing timer control to do this? I'd appreciate any general ideas about this, or let me know if it's a bad way to do this.
Thanks for any input,
Dave
'Hello World'
-
March 18th, 2007, 11:56 AM
#2
Re: Global Timer Class with Events?
You could have a form that's open all the time, yet minimized that has the timer in it. Or else, use some API's to mimic one yourself.
Code:
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|