NumXL SDK - Licensing API
Licensing functions

API for query, generate and verify license keys, subscriptions, activation codes, etc. More...

Functions

int __stdcall SFLUC_LICENSE_DURATION (int *nLen)
 Query and retrieve the license key duration (e.g. annual, semi-annual, etc.)
 
int __stdcall SFLUC_LICENSE_LEVEL (int *nlevel)
 Query and retrieve the license level of the active license key.
 
int __stdcall SFLUC_MACHINEID (LPWSTR szBuffer, size_t *nLen)
 Query and retrieve the unique identifier of the local machine.
 
int __stdcall SFLUC_LICENSE_KEY (LPWSTR szBuffer, size_t *nLen)
 Query and retrieve the current license key.
 
int __stdcall SFLUC_LICENSE_KEY_EXPIRY (unsigned long *expiry)
 Query and retrieve the expiration date of the curent license key.
 
int __stdcall SFLUC_ACTIVATION_CODE (LPWSTR szBuffer, size_t *nLen)
 Query and retrieve the activation code of the curent license key.
 
int __stdcall SFLUC_LICENSE_STATUS (void)
 Query and retrieve the activation status of curent license key.
 
int __stdcall SFLUC_CHECK_KEYCODE (LPCWSTR PDKey, LPCWSTR szKey, LPCWSTR szActCode, ULONG *ulExpiry, int *nLevel)
 a general function for bootstrapping expiry date and nlevel from a key/code pair
 
int __stdcall SFLUC_UPDATEVERSION (LPCWSTR szLicenseKey, LPCWSTR szFileVersion, LPWSTR updateVersion, size_t *pVerSize, LPWSTR downloadURL, size_t *pURLSize)
 Query and retrieve the latest version available.
 
int __stdcall SFLUC_SERVICEDATE (LPCWSTR szLicenseKey, LPLONG serviceDate)
 Query and retrieve the service date for a given license.
 
int __stdcall SFLUC_ACTIVATE_LICENSE (LPCWSTR szLicenseKey, LPCWSTR szEmail, LPCWSTR szProdCode, LPWSTR szActivationCode, size_t *puSize)
 Query and retrieve the recent activation code for a given license.
 
int __stdcall SFLUC_DEACTIVATE_LICENSE (LPCWSTR szLicenseKey)
 Deactiveate the license key on the given machine (i.e., user's account)
 
int __stdcall SFLUC_LOOKUP_LICENSE (LPCWSTR szEmail, LPCWSTR szProdCode, LPWSTR szLicenseKey, size_t *puSize)
 Lookup license key for a given email address.
 
int __stdcall SFLUC_UPDATE_LICENSE (LPCWSTR szLicenseKey, LPCWSTR szFirstName, LPCWSTR szLastName, LPCWSTR szEmail, LPCWSTR szCompany)
 Update the license key information: Name, Company and E-Mail.
 
int __stdcall SFLUC_REQ_TRIAL_LICENSE (LPCWSTR szFirstName, LPCWSTR szLastName, LPCWSTR szEmail, LPCWSTR szCompany, LPCWSTR szPhoneNo, LPCWSTR szProdCode)
 Request a 14-day trial license key.
 

Detailed Description

API for query, generate and verify license keys, subscriptions, activation codes, etc.

Function Documentation

◆ SFLUC_ACTIVATE_LICENSE()

int __stdcall SFLUC_ACTIVATE_LICENSE ( LPCWSTR szLicenseKey,
LPCWSTR szEmail,
LPCWSTR szProdCode,
LPWSTR szActivationCode,
size_t * puSize )

Query and retrieve the recent activation code for a given license

Parameters
[in]szLicenseKey(Required) the License key code.
[in]szEmail(Required) the E-Mail address associated with the license key
[in]szProdCode(Required) the product code (e.g. 3223-200)
[out]szActivationCode(Optional) the activation code
[in,out]puSize(Required) a pointer to a variable that specifies the size of the buffer pointed to by the szActivationCode parameter, in characters. When the function returns, this variable contains the size of the data copied to szActivationCode.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If value of szLicenseKey, szEmail or szProdCode is NULL, the function will fail and return NDK_INVALID_ARG error code.
  2. If the value of szActivationCode is not NULL and the value of puSize is zero (0), the function will fail and return NDK_LENGTH_ERROR error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_ACTIVATION_CODE()

int __stdcall SFLUC_ACTIVATION_CODE ( LPWSTR szBuffer,
size_t * nLen )

Query and retrieve the activation code of the curent license key

Parameters
[out]szBufferThe buffer that will receive the activation code
[in,out]nLenA pointer to a variable that specifies the size of the buffer pointed to by the szBuffer parameter, in characters. When the function returns, this variable contains the size of the data copied to szBuffer.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
  2. If szBuffer is NULL, and nLen is non-NULL, the function returns NDK_SUCCESS and stores the size of the data, in bytes, in the variable pointed to by nLen. This enables an application to determine the best way to allocate a buffer for the value's data.
  3. If the szBuffer buffer is too small (less than 32-characters) to receive the data, the function returns NDK_LENGTH_ERROR.
  4. If the nLen is NULL, the function returns NDK_INVALID_ARG.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also
  • SFLUC_Init

◆ SFLUC_CHECK_KEYCODE()

int __stdcall SFLUC_CHECK_KEYCODE ( LPCWSTR PDKey,
LPCWSTR szKey,
LPCWSTR szActCode,
ULONG * ulExpiry,
int * nLevel )

Query and retrieve the expiration date and license level of a license key and activation code

Parameters
[in]PDKey(Required) Is the Product key (i.e. 31223-200-162)
[in]szKey(Required) Is the License key
[in]szActCode(Required) Is the Activation code.
[out]ulExpiry(Optional) a pointer to a varaible that holds the expiration date expressed as number of days since January 1st, 1970
[out]nLevel(Optional) a pointer to a variable that holds the Effective license level: 1=Limited, 2=Full/Pro
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_INVALID_KEY_CODEfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The operation of this function does not rely on the initialization of the license module.
  2. If any value of PDKey, szKey or szActCode is NULL, the function will fails and return NDK_INVALID_ARG error code.
  3. If the value of the szActCode does not corresponds to a valid activation code, the function will fail and return NDK_INVALID_ARG error code.
  4. If the value of the szKey does not corresponds to a valid license key string, the function will fail and return NDK_INVALID_ARG error code.
  5. If the function fails to compute an expiry date using the values in PDKey, szKey or szActCode, the function will fail and return NDK_INVALID_KEY_CODE error code.
  6. If the value of ulExpiry is NULL, the expiration date is not returned.
  7. If the value of nLevel is NULL, the license level is not returned.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_DEACTIVATE_LICENSE()

int __stdcall SFLUC_DEACTIVATE_LICENSE ( LPCWSTR szLicenseKey)

Deactiveate the license key on the given machine (i.e., user's account)

Parameters
[in]szLicenseKey(Required) is the NumXL License key string (e.g., 79F7-...)
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If value of szLicenseKey is NULL, the function will fail and return NDK_INVALID_ARG error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_LICENSE_DURATION()

int __stdcall SFLUC_LICENSE_DURATION ( int * nLen)

Query and retrieve the license key duration (e.g. annual, semi-annual, etc.)

Parameters
[out]nLen(Required) a pointer to a variable that holds the license duration (1=trial, 2=perpetual, 3=annual, 4=semi-annual)
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
  2. If the value of nLen is NULL, the function will fail and return NDK_INVALID_ARG as return code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_LICENSE_KEY()

int __stdcall SFLUC_LICENSE_KEY ( LPWSTR szBuffer,
size_t * nLen )

Query and retrieve the current license key

Parameters
[out]szBufferIs the output buffer that will receive the License key
[in,out]nLenA pointer to a variable that specifies the size of the buffer pointed to by the szBuffer parameter, in characters. When the function returns, this variable contains the size of the data copied to szBuffer.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license system has not been initalized yet, the function returns NDK_UNINITIALIZED.
  2. If szBuffer is NULL, and nLen is non-NULL, the function returns NDK_SUCCESS and stores the size of the data, in bytes, in the variable pointed to by nLen. This enables an application to determine the best way to allocate a buffer for the value's data.
  3. If the szBuffer buffer is too small to receive the data, the function returns NDK_LENGTH_ERROR.
  4. If the nLen is NULL, the function returns NDK_INVALID_ARG.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_LICENSE_KEY_EXPIRY()

int __stdcall SFLUC_LICENSE_KEY_EXPIRY ( unsigned long * expiry)

Query and retrieve the expiration date of the curent license key

Parameters
[out]expiryIs the expiration date of the active license expressed as number of days since January 1st, 1970
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
  2. If the value of expiry is NULL, the function will fail and return a NDK_INVALID_ARG error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_LICENSE_LEVEL()

int __stdcall SFLUC_LICENSE_LEVEL ( int * nlevel)

Query and retrieve the license level of the active license key

Parameters
[out]nlevelA pointer to a variable that, upon the function returns, contains the active license level (1=limited, 2=Pro).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsucess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_INACTIVE_LICENSE_KEYfailed (see remarks)
NDK_INVALID_LICENSE_KEYfailed (see remarks)
NDK_EXPIRED_LICENSE_KEYfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the nlevel is NULL, the function returns NDK_INVALID_ARG.
  2. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
  3. If the selected license key in not activated, the functions returns NDK_INACTIVE_LICENSE_KEY.
  4. If the selected license key is invalid, for some reason, then the function returns NDK_INVALID_LICENSE_KEY.
  5. If the current date is after the expiry date of the activated (non-perpetual) license key, the function returns NDK_EXPIRED_LICENSE_KEY
  6. For perpetual and active license key (with a valid activation code), the function will succeed and return NDK_SUCCESS.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_LICENSE_STATUS()

int __stdcall SFLUC_LICENSE_STATUS ( void )

Query and retrieve the activation status of curent license key

Parameters
None.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_KEY_IN_TRIAL_PERODsuccess (see remarks)
NDK_KEY_IN_LITE_MODEsuccess (see remarks)
NDK_PERP_KEY_ACTIVEsuccess (see remarks)
NDK_SUB_KEY_ACTIVEsuccess (see remarks)
NDK_UNINITIALIZEDfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_LOOKUP_LICENSE()

int __stdcall SFLUC_LOOKUP_LICENSE ( LPCWSTR szEmail,
LPCWSTR szProdCode,
LPWSTR szLicenseKey,
size_t * puSize )

Lookup license key for a given email address

Parameters
[in]szEmail(Required) is the email address associated with the desired license key.
[in]szProdCode(Required) is the product code that license key can be used with
[out]szLicenseKey(Optional) is a buffer to hold the return license key
[in,out]puSize(Required) a pointer to a variable that holds the size of the buffer pointed to by the szLicenseKey parameter, in characters. When the function returns, this variable contains the size of the data copied to szLicenseKey.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The operation of this function does not rely on the initialization of the license module.
  2. If value of szEmail, szProdCode or puSize is NULL, the function will fail and return NDK_INVALID_ARG error code.
  3. If the szLicenseKey pointer is not NULL, but its size (passed by puSize) is smaller than needed, the function will fail and return NDK_LENGTH_ERROR error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_MACHINEID()

int __stdcall SFLUC_MACHINEID ( LPWSTR szBuffer,
size_t * nLen )

Query and retrieve the unique identifier of the local machine

Parameters
[out]szBufferA pointer to a buffer that receives the value's data. This parameter can be NULL if the data is not required.
[in,out]nLenA pointer to a variable that specifies the size of the buffer pointed to by the szBuffer parameter, in characters. When the function returns, this variable contains the size of the data copied to szBuffer.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_LENGTH_ERRORfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The operation of this function does not rely on the initialization of the license module.
  2. If szBuffer is NULL, and nLen is non-NULL, the function returns NDK_SUCCESS and stores the size of the data, in bytes, in the variable pointed to by nLen. This enables an application to determine the best way to allocate a buffer for the value's data.
  3. If the szBuffer buffer is too small to receive the data, the function returns NDK_LENGTH_ERROR.
  4. If the nLen is NULL, the function returns NDK_INVALID_ARG.
Examples
size_t nSize = 64;
std::vector<TCHAR> machineId(nSize, TCHAR(0x00));
intnRet = SFLUC_MACHINEID(&machineId[0], &nSize);
if(nRet == NDK_SUCCESS){
//Success
....
}
#define NDK_SUCCESS
int __stdcall SFLUC_MACHINEID(LPWSTR szBuffer, size_t *nLen)
Query and retrieve the unique identifier of the local machine.
Definition SFLUC.cpp:481
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_REQ_TRIAL_LICENSE()

int __stdcall SFLUC_REQ_TRIAL_LICENSE ( LPCWSTR szFirstName,
LPCWSTR szLastName,
LPCWSTR szEmail,
LPCWSTR szCompany,
LPCWSTR szPhoneNo,
LPCWSTR szProdCode )

Request a 14-day trial license key

Parameters
[in]szFirstName(Required) is the customer first name
[in]szLastName(Required) is the customer last name
[in]szEmail(Required) is the new email address to associat the license key with.
[in]szCompany(Optional) is the company name or organization the customer belong to
[in]szPhoneNo(Optional) is the phone number.
[in]szProdCode(Required) is the product code that license key can be used with.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The operation of this function does not rely on the initialization of the license module.
  2. If value of szEmail, szProdCode or puSize is NULL, the function will fail and return NDK_INVALID_ARG error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_SERVICEDATE()

int __stdcall SFLUC_SERVICEDATE ( LPCWSTR szLicenseKey,
LPLONG serviceDate )

Query and retrieve the service date for a given license

Parameters
[in]szLicenseKey(Required) the License key code.
[out]serviceDate(Required) a pointer to a varaible to hold the serial date number of the service/support expiry date
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_FAILEDfailed
Remarks
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_UPDATE_LICENSE()

int __stdcall SFLUC_UPDATE_LICENSE ( LPCWSTR szLicenseKey,
LPCWSTR szFirstName,
LPCWSTR szLastName,
LPCWSTR szEmail,
LPCWSTR szCompany )

Update the license key information: Name, Company and E-Mail

Parameters
[in]szLicenseKey(Required) is the license key to update
[in]szFirstName(Required) is the customer first name
[in]szLastName(Required) is the customer last name
[in]szEmail(Required) is the new email address to associat the license key with.
[in]szCompany(Optional) is the company name or organization the customer belong to
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The operation of this function does not rely on the initialization of the license module.
  2. If value of szEmail or szLicenseKey is NULL, the function will fail and return NDK_INVALID_ARG error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also

◆ SFLUC_UPDATEVERSION()

int __stdcall SFLUC_UPDATEVERSION ( LPCWSTR szLicenseKey,
LPCWSTR szFileVersion,
LPWSTR updateVersion,
size_t * pVerSize,
LPWSTR downloadURL,
size_t * pURLSize )

Query and retrieve the latest version available

Parameters
[in]szLicenseKey(Required) the License key.
[in]szFileVersion(Required) the long file version (1.XX.XXXX.X).
[out]updateVersion(Optional) a pointerto a buffer to hold the available most recent version available.
[in,out]pVerSize(Required) a pointer to a variable that specifies the size of the buffer pointed to by the updateVersion parameter, in characters. When the function returns, this variable contains the size of the data copied to updateVersion.
[out]downloadURL(Optional) a pointer to a buffer to hold the download URL version.
[in,out]pURLSize(Optional) a pointer to a variable that specifies the size of the buffer pointed to by the downloadURL parameter, in characters. When the function returns, this variable contains the size of the data copied to downloadURL.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If value of szLicenseKey, szFileVersion, pURLSize or pVerSize is NULL, the function will fail and return NDK_INVALID_ARG error code.
  2. If the value of updateVersion is not NULL and the value of pVerSize is zero (0), the function will fail and return NDK_LENGTH_ERROR error code.
  3. If the value of downloadURL is not NULL and the value of pURLSize is zero (0), the function will fail and return NDK_LENGTH_ERROR error code.
Requirements
Requirement Value
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll
SFLOG.dll
See also