ISCONTROLREGISTERED()

  

DEVELOPER

 

 

Purpose

.IsControlRegistered is a method for checking if an ActiveX control is present on a Client and optionally meets a minimum version. It is an alternative to the check that can be defined in the Property Sheet for an ActiveX object. You can set it programmatically to call alternate functions or windows if the control is not installed, or use it to support older versions.  

Object Type

Client

Syntax

Variable = Client.IsControlRegistered(Control Program ID {, Version Info})

Operation

Variable is any numeric variable for the returned code.
Control Program ID
requires the program ID of the ActiveX control that you are checking. This can be obtained via the ActiveX Gallery.
Version Info
checks to see if the control meets a minimum version. Typically, controls have a four digit version containing the major, minor, build and patch numbers. For example, "6.0.2900.5512".

The parameters are either literal texts or alpha variables. 

Remarks

The return codes are as follows:

1 - Control is registered and meets the minimum version number supplied.

2 - Control is registered, but does not meet the minimum version number supplied.

3 - Control is not registered.

Additionally, the return value is also set in the numeric system variable @ERR, and the actual version of the control that is installed is returned to the alpha @ERRTEXT system variable. 

Example

To check the Microsoft Common Dialogue Control Version 6 is present on the client, meets the minimum version and displays the return code to the user:

#RC = Client.IsControlRegistered("MSComDlg.CommonDialog.1","6.0.2900.5512")

UMSG('Control is registered=' + ALPHA(#RC),-1)

Comment on this topic

Topic ID: 510111