Returns the Natural Access version, build date, and compatibility level.
DWORD ctaGetVersion ( CTA_REV_INFO *pinfo, DWORD size)
Argument |
Description |
pinfo |
Pointer to the memory area. The CTA_REV_INFO structure is: typedef struct See the Details section for a description of these fields. |
size |
Size of the data structure. |
Return value |
Description |
CTAERR_BAD_SIZE |
size is not valid. |
CTAERR_BAD_ARGUMENT |
pinfo is NULL. |
CTAERR_SVR_COMM |
Server communication error. |
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.
/* 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);
}
}