ctaGetVersion

Returns the Natural Access version, build date, and compatibility level.

Prototype

DWORD ctaGetVersion ( CTA_REV_INFO *pinfo, DWORD size)

Argument

Description

pinfo

Pointer to the memory area. The CTA_REV_INFO structure is:

typedef struct
{
  DWORD size;
  DWORD majorrev;
  DWORD minorrev;
  char  builddate [12];
  DWORD compatlevel;
} CTA_REV_INFO;

See the Details section for a description of these fields.

size

Size of the data structure.


Return values

Return value

Description

CTAERR_BAD_SIZE

size is not valid.

CTAERR_BAD_ARGUMENT

pinfo is NULL.

CTAERR_SVR_COMM

Server communication error.


Details

ctaGetVersion returns the Natural Access version, build date, and compatibility level.

The CTA_REV_INFO structure contains the following fields:

Field

Description

size

Number of bytes written at the address pointed to by pinfo.

majorrev

Major revision number of Natural Access. This value changes when a Natural Access release contains major enhancements such as new APIs or new services.

minorrev

Minor revision of Natural Access. This value changes when a Natural Access release contains minor enhancements, bug fixes, or both.

builddate

A NULL-terminated string indicating the build date of the revision, in mm dd yyyy format.

compatlevel

Compatibility level of the specified library. The compatibility level changes when the release includes enhancements that require applications to be recompiled because the changes are not backward compatible.


Refer to Verifying compatibility for more information.

See also

ctaGetVersionEx

Example

/* Abort execution if NMS delivers version with compatibility level changed: */

void DemoCheckVersion( void )
{
    CTA_REV_INFO info;
    
    ctaGetVersion( &info, sizeof(info) );
    if ( info.compatlevel != CTA_COMPATLEVEL )
    {
        printf("Natural Access compatibility level does not match. 
        Re-compile.\n"); 
        exit(-1);
    }
}