DllVersion and DllVersion$ Functions, CommCtlVersion, ShellVersion Properties

Purpose

Return the version number of a DLL

Syntax

v! = DllVersion([fname])
v$ = DllVersion$([fname])

v! = Screen. CommCtlVersion
v! = Screen. ShellVersion

v!: single expression
v$, fname: string expressions

Description

DllVersion(fname) returns the version number of a given DLL fname, if the DLL supports the version info function, otherwise it returns 0; if the DLL isn't located, the function returns -1. All values are returned as Single variables.

In a similar way, DllVersion$(fname) returns a string containing extended version information of a given DLL fname. When the DLL doesn't support the version info function, it returns an empty string, and when the DLL can't be found, the function returns "Error".

DllVersion() or DllVersion("") return the version number of the gfawin32.ocx runtime, while DllVersion$() or DllVersion$("") return the version information in the form of a string.

CommCtlVersion returns the DLL version number of CommCtl.dll, while ShellVersion returns the DLL version number of Shell32.dll.

Example

Trace DllVersion("shell32.dll")

// or, using the Screen object

Trace Screen.ShellVersion

// or using DllVersion$

Trace DllVersion$("shell32.dll")

Trace Screen.CommCtlVersion

Trace DllVersion()      // Prints the GFA runtime version...

Trace DllVersion$("")   // ...as does this.

Debug.Show

Known Issues

GFABASIC sometimes has problems processing comparisons involving DllVersion because DllVersion returns a floating point/single variable and all 'magic numbers' are assumed by GFABASIC to be double. The workaround for this is to place a ! after the comparison 'magic number' (to make it a single) as shown below:

// Run using GfaWin23 v2.32

Print DllVersion > 2.31         // Sometimes TRUE, sometimes not

Print DllVersion > 2.31!        // Always TRUE

[Reported by James Gaite, 23/10/2017; Solution updated by Sjouke Hamstra 05/11/2017]

{Created by Sjouke Hamstra; Last updated: 05/11/2017 by James Gaite}