Versions Compared

Key

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

...

Code Block
languagecpp
#include <lmx.h>
#include <stdio.h>

LMX_HANDLE h;

int main() {
  LMX_FEATURE_INFO FI;

  exit_on_error(LMX_Init(&h));
  exit_on_error(LMX_Checkout(h, "f2", 1, 0, 1));
  exit_on_error(LMX_GetFeatureInfo(h, "f2", &FI));
  printf("FeatureName : %s\n", FI.szFeatureName);
  printf("VendorName : %s\n", FI.szVendorName);
  return 0;
}

The You can use the following code lists information about to check the time remaining to the expiration of a license and, depending feature. Depending on which type of license is in use, it the function either prints out information that the feature does not expire, or it displays the time remaining to the expirationreturns the number of hours before the feature expires.

Code Block
languagecpp
#include <lmx.h>
#include <stdio.h>

LMX_HANDLE h;

int main() {
  LMX_FEATURE_INFO FI;

  exit_on_error(LMX_Init(&h));
  exit_on_error(LMX_Checkout(h, "f2", 1, 0, 1));
  exit_on_error(LMX_GetFeatureInfo(h, "f2", &FI));
  int nTimeLeft;
  nTimeLeft = LMX_GetExpireTime(h, "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);
  return 0;
}