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_LICENSE_EXPIRY (LPCWSTR szKey, LPCWSTR szActivationCode, unsigned long *expiry)
 Query and retrieve the expiration date of a given license key and activation code.
 
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.
 
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 )
Parameters
[in]szLicenseKey(Required) Is the License key
[in]szEmail(Required) Is the E-Mail address associated with the license key
[in]szProdCode(Required) Is the product code (e.g. 3223-200)
[out]szActivationCodeIs the activation code
[in,out]puSizeA pointer to a variable that specifies the size of the buffer pointed to by the szActivationCode parameter, in bytes. 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_FAILEDunknown error
See also
SFLUC_UPDATEVERSION, SFLUC_LICENSE_LEVEL
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_ACTIVATION_CODE()

int __stdcall SFLUC_ACTIVATION_CODE ( LPWSTR szBuffer,
size_t * nLen )
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 bytes. 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_FAILEDunknown error
See also
SFLUC_Init
Remarks
  1. The buffer size should be at least 32 characters (wide-character)
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_CHECK_KEYCODE()

int __stdcall SFLUC_CHECK_KEYCODE ( LPCWSTR PDKey,
LPCWSTR szKey,
LPCWSTR szActCode,
ULONG * ulExpiry,
int * nLevel )
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]ulExpiryIs the expiration date expressed as number of days since January 1st, 1970
[out]nLevelIs 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_FAILEDunknown error
See also
SFLUC_LICENSE_EXPIRY, SFLUC_LICENSE_LEVEL

a general function for bootstrapping expiry date and nlevel from a key/code pair

Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_DEACTIVATE_LICENSE()

int __stdcall SFLUC_DEACTIVATE_LICENSE ( LPCWSTR szLicenseKey)
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_FAILEDunknown error
See also
SFLUC_UPDATEVERSION, SFLUC_LICENSE_LEVEL
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_LICENSE_DURATION()

int __stdcall SFLUC_LICENSE_DURATION ( int * nLen)
Parameters
[out]nLenIs 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_FAILEDunknown error
See also
SFLUC_LICENSE_LEVEL
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_LICENSE_EXPIRY()

int __stdcall SFLUC_LICENSE_EXPIRY ( LPCWSTR szKey,
LPCWSTR szActivationCode,
unsigned long * expiry )
Parameters
[in]szKey(Required) Is the license key
[in]szActivationCode(Required) Is the activation code for the given license key.
[out]expiryIs the expiration date 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_FAILEDunknown error
See also
SFLUC_CHECK_KEYCODE

◆ SFLUC_LICENSE_KEY()

int __stdcall SFLUC_LICENSE_KEY ( LPWSTR szBuffer,
size_t * nLen )
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 bytes. 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_FAILEDunknown error
See also
SFLUC_ACTIVATION_CODE
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_LICENSE_KEY_EXPIRY()

int __stdcall SFLUC_LICENSE_KEY_EXPIRY ( unsigned long * expiry)
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_FAILEDunknown error
See also
SFLUC_ACTIVATION_CODE
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_LICENSE_LEVEL()

int __stdcall SFLUC_LICENSE_LEVEL ( int * nlevel)
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_SUCCESSThe function succeeds.
NDK_UNINITIALIZEDThe license system has not been initalized yet.
NDK_INVALID_ARGThe nlevel argument is NULL.
NDK_INACTIVE_LICENSE_KEYThe selected license key in not activated.
NDK_INVALID_LICENSE_KEYThe selected license key is invalid.
NDK_EXPIRED_LICENSE_KEYThe current date is after the expiry date of the activated license key.
NDK_FAILEDThe function fails.
See also
SFLUC_LICENSE_DURATION
Remarks
  1. If the nlevel is NULL, the function returns NDK_INVALID_ARG.
  2. If the license system has not been initalized yet, the function returns NDK_UNINITIALIZED.
  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 license key, the function returns NDK_EXPIRED_LICENSE_KEY
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_LICENSE_STATUS()

int __stdcall SFLUC_LICENSE_STATUS ( void )
Parameters
None.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_FAILEDunknown error
See also
SFLUC_LICENSE_STATUS,SFLUC_LICENSE_KEY
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_LOOKUP_LICENSE()

int __stdcall SFLUC_LOOKUP_LICENSE ( LPCWSTR szEmail,
LPCWSTR szProdCode,
LPWSTR szLicenseKey,
size_t * puSize )
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]puSizeA pointer to a variable that specifies the size of the buffer pointed to by the szLicenseKey parameter, in bytes. 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_FAILEDunknown error
See also
SFLUC_UPDATEVERSION, SFLUC_LICENSE_LEVEL
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_MACHINEID()

int __stdcall SFLUC_MACHINEID ( LPWSTR szBuffer,
size_t * nLen )
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 bytes. 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_SUCCESSThe function succeeds.
NDK_LENGTH_ERRORThe szBuffer buffer is too small to receive the data.
NDK_INVALID_ARGThe nLen argument is NULL.
NDK_FAILEDThe function fails.
See also
SFLUC_CHECK_LICENSE
Remarks
  1. 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.
  2. If the szBuffer buffer is too small to receive the data, the function returns NDK_LENGTH_ERROR.
  3. If the nLen is NULL, the function returns NDK_INVALID_ARG.
Examples
size_t nSize = 64;
std::vector<TCHAR> machineId(nSize, TCHAR(0x00));
int nRet = 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:499
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_REQ_TRIAL_LICENSE()

int __stdcall SFLUC_REQ_TRIAL_LICENSE ( LPCWSTR szFirstName,
LPCWSTR szLastName,
LPCWSTR szEmail,
LPCWSTR szCompany,
LPCWSTR szPhoneNo,
LPCWSTR szProdCode )
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 operation
Return values
NDK_SUCCESSOperation successful
Warningor Error code
See also
SFLUC_LOOKUP_LICENSE
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_SERVICEDATE()

int __stdcall SFLUC_SERVICEDATE ( LPCWSTR szLicenseKey,
LPLONG serviceDate )
Parameters
[in]szLicenseKey(Required) Is the License key
[out]serviceDateIs 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_FAILEDunknown error
See also
SFLUC_UPDATEVERSION, SFLUC_LICENSE_LEVEL
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_UPDATE_LICENSE()

int __stdcall SFLUC_UPDATE_LICENSE ( LPCWSTR szLicenseKey,
LPCWSTR szFirstName,
LPCWSTR szLastName,
LPCWSTR szEmail,
LPCWSTR szCompany )
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_FAILEDunknown error
See also
SFLUC_LOOKUP_LICENSE, SFLUC_ACTIVATE_LICENSE
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll

◆ SFLUC_UPDATEVERSION()

int __stdcall SFLUC_UPDATEVERSION ( LPCWSTR szLicenseKey,
LPCWSTR szFileVersion,
LPWSTR updateVersion,
size_t * pVerSize,
LPWSTR downloadURL,
size_t * pURLSize )
Parameters
[in]szLicenseKey(Required) Is the License key
[in]szFileVersion(Required) is the long file version (1.XX.XXXX.X)
[out]updateVersionIs the available most recent version available
[in,out]pVerSizeA pointer to a variable that specifies the size of the buffer pointed to by the updateVersion parameter, in bytes. When the function returns, this variable contains the size of the data copied to updateVersion.
[out]downloadURLis the download URL version
[in,out]pURLSizeA pointer to a variable that specifies the size of the buffer pointed to by the downloadURL parameter, in bytes. 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_FAILEDunknown error
See also
SFLUC_SERVICEDATE
Remarks
Requirements
Target Platform Windows
Header SFLUC.h (include Windows.h)
Library SFLUC.lib
DLL SFLUC.dll