Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
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 the feature expires.

0

The feature expires within the hour.

-1

The feature is expired or an error occurred (for example, LmxHandle is null NULL or the feature does not exist).

-2

The feature has no expiration date.

...

You can use LMX_GetFeatureInfo to get the license expiration date.

Example:

You can use the following code to return the number of hours left before the feature expires.

Code Block
languagecpp
/* 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);