You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The LMX_GetExpireTime function returns the number of hours remaining before the feature expires.

Prototype

int LMX_GetExpireTime
(
LMX_HANDLE LmxHandle,
const char *szFeatureName
);

Parameters

LmxHandle
[in] LM-X handle.

szFeatureName
[in] Feature name.

Return Values

This function returns the number of hours left before the feature expires.

Return value

Description

> 0

Number of hours left before expire.

0

Expires within the hour.

-1

Is expired.

-2

Feature has no expire date.

Remarks

If a local or network license has an expiration, that is the expiration time returned. If a borrow, grace or trial license is in use, that is the expiration time returned. After the borrow or grace license expires, the expiration time of the local or network license will once again be the information that is returned.

You can use LMX_GetFeatureInfo (see LMX_GetFeatureInfo) to get the license expiration date.

Example:

/* Get the expire time for a feature */
int nTimeLeft;
LMX_FEATURE_INFO FI;
/* Try to see which type of feature this is */
LMX_GetFeatureInfo(LmxHandle, "f2", &FI);
nTimeLeft = LMX_GetExpireTime(LmxHandle, "f2");
if (nTimeLeft == -2)
  printf("This feature does not expire\n");
else if (nTimeLeft == -1)
  printf("This feature is expired\n");
else /* feature has not yet expired */ 
printf("Hours left for this feature: %d\n", nTimeLeft);  
  • No labels