...
Code Block | ||
---|---|---|
| ||
#include <lmx.h> #include <stdio.h> LMX_HANDLE h; int main() { LMX_STATUS s; LMX_LICENSE_INFO *pLicenseInfo; LMX_FEATURE_INFO *pFI; exit_on_error(LMX_Init(&h)); if ((s = LMX_GetLicenseInfo(h, &pLicenseInfo)) != LMX_SUCCESS) exit_on_error(s); for (; pLicenseInfo != NULL; pLicenseInfo = pLicenseInfo->pNext) { printf("LicencePath : %s\n", pLicenseInfo->szPath); printf("Port : %d\n", pLicenseInfo->nPort); printf("Type : "); if (pLicenseInfo->eLicenseType == LMX_TYPE_LOCAL) printf("Locale\n"); else if (pLicenseInfo->eLicenseType == LMX_TYPE_NETWORK) printf("Network\n"); printf("Features:\n\n"); for (pFI = pLicenseInfo->pFeature; pFI != NULL; pFI = pFI->pNext) { printf("FeatureName : %s\n", pFI->szFeatureName); printf("VendorName : %s\n", pFI->szVendorName); } } return 0; } |
For a more complete example of using these structures, see the sample files included in the LM-X distribution.
All memory used by these structures is handled and maintained by LM-X. It is assumed to be valid until a new request to LMX_GetLicenseInfo is made.
This function is currently available for use only with C, C++ (excluding Java) and .NET.