VB Timer Replacement

By | 2002-06-01

This is an OCX example of the SetTimer and KillTimer API calls. You can essentially replace the VB timer with this example. The Interval property can be set to as long as 24 days. It also has a ProcessPriority property to easily change the priority of your application.

Original Author: Paul Mather

Returns

Has the same properties and events as the standard VB Timer.

Side Effects

Please note that the API does not seem to have the necessary resolution to keep accurate time. If you count 60 ticks of 1000 msec interval, you’ll find that it actually took longer than that 60000 msec. This can get worse with high processor load. This (as with the standard VB timer) should be used as a re-occurring event trigger rather than a time accurate counter.
Please note that wrapping the SetTimer and KillTimer API calls in an OCX is not necessarily desirable. For demonstrative purposes, this is the easiest way. However, in actual implementation, it would be bast to just have the IDBAS_Timer module.

Attachments

FileUploadedSize
CODE_UPLOAD947.zip9/3/2020 3:45:00 PM12749
Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.