ccrpTimer Object

Properties  Methods  Events

Object Name: 
ccrpTimer
Description: 
Extremely accurate replacement for VB's standard Timer control.
File Name: 
ccrpTmr.dll
Help File: 
ccrpTmr.chm
GUID: 
{d1866abd-bec8-11d1-bbac-0055003b26de}
Properties: 
7
Events: 
1
Methods: 
1

Before you can use ccrpTimer object in your application, you must add the ccrpTmr.dll file to your project. If you use the object in most of your VB projects, you may want to add it to VB's Autoload file.

To distribute applications you create with the ccrpTimer object, you must install and register it on the user's computer. The Setup Wizard provided with Visual Basic provides tools to help you do that. Please refer to the Visual Basic manual for details. A dependency file (ccrpTmr.DEP) has been included for your convenience.

General Usage

When declaring a new instance of ccrpTimer, use the special syntax first made available with VB5 to do so with full event support. Place a declaration similar to the following in the Declarations section of either a form or class module:

   Private WithEvents Timer1 As ccrpTimer

At this point, you'll note that Timer1 appears in the objects dropdown within that module's code window. By selecting Timer1 from this list, a new event will be placed into your code:

   Private Sub Timer1_Timer()

End Sub

Typically, you'll want to initialize the ccrpTimer object in either the Form_Load or Class_Initialize event:

   Set Timer1 = New ccrpTimer

At any point after initializing the object, you may start setting its various property values. Use Interval to set how often the Timer event should occur. The EventType property specifies whether to notify you continually (just like VB's Timer control) or to set up a single occurance event. As with VB's Timer control, Enabled turns the ccrpTimer object on and off.

As with the other objects in the ccrpTimers library, properties are exposed via the Stats object to reveal the MinimumResolution and MaximumResolution settings supported on the current hardware. Additionally, a Resolution property is exposed to inform you what resolution the library is currently using. You may also set or read the Frequency of the timer being used by ccrpTimers through Stats.

In general, your application should not set a frequency higher than absolutely necessary, to avoid forcing the CPU to process extraneous hardware interrupts. See About Multimedia Timers for more details.