install_routine

The install_routine function is the first function called when a gauge is loaded; install_routine installs the gauge. Required by the Panel API; install_routine is one of the functions that defines the gauge interface.

Syntax

install_routine (HINSTANCE resource_file_handle)

The install_routine syntax has these parameters:

Parameter Description
HINSTANCE
resource_file_handle Specifies the instance handle of the gauge DLL.

Example

void install_routine(HINSTANCE resource_file_handle)

{

element_list_install(list, resource_file_handle);

mouse_list_install(mouse_rect, &gauge_header,

&background.image_data.final->dim);

mouse_list_register(mouse_rect, &gauge_header);

}

Remarks

To install the drawing elements, you must call either (Panel API functions) the element_list_install function or the element_install function in the install_routine function. If your gauge uses mouse rectangles, enable mouse rectangles by calling mouse_list_install and mouse_list_register in the install_routine function.

The install_routine function is a good place to allocate memory or initialize data that's specific to the gauge you're building. Some gauges require that you use several token variables; you can use install_routine to initialize these variables.