Dev Center
Table of contents

License Methods

Method Description
InitLicense Read product key and activate the SDK.
InitLicenseFromServer Initialize license and connect to the specified server for online verification.
InitLicenseFromLicenseContent Initialize license from the license content on client machine for offline verification.
OutputLicenseToString Output the license content to a string from the license server.
OutputLicenseToStringPtr Output the license content to a string from the license server.
FreeLicenseString Free memory allocated for the license string.
InitDLSConnectionParameters Initializes a DM_DLSConnectionParameters struct with default values.
InitLicenseFromDLS Initializes the barcode reader license and connects to the specified server for online verification.
GetIdleInstancesCount Gets available instances count when charging by concurrent instances count.
InitLTSConnectionParameters Deprecated. Use InitDLSConnectionParameters instead.
InitLicenseFromLTS Deprecated. Use InitLicenseFromDLS instead.

InitLicense

Read product key and activate the SDK.

int dynamsoft::dbr::CBarcodeReader::InitLicense (const char* pLicense)	

Parameters
[in] pLicense The product keys.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

Code Snippet

CBarcodeReader* reader = new CBarcodeReader();
reader->InitLicense("t0260NwAAAHV***************");
delete reader;

InitLicenseFromServer

Initialize the license and connect to the specified server for online verification.

int dynamsoft::dbr::CBarcodeReader::InitLicenseFromServer (const char* pLicenseServer, const char* pLicenseKey)

Parameters
[in] pLicenseServer The URL of the license server.
[in] pLicenseKeyThe license key.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

InitLicenseFromLicenseContent

Initialize barcode reader license from the license content on the client machine for offline verification.

int dynamsoft::dbr::CBarcodeReader::InitLicenseFromLicenseContent (const char* pLicenseKey, const char* pLicenseContent)	

Parameters
[in] pLicenseKey The license key.
[in] pLicenseContent An encrypted string representing the license content (quota, expiration date, barcode type, etc.) obtained from the method OutputLicenseToString.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

OutputLicenseToString

Output the license content as an encrypted string from the license server to be used for offline license verification.

int dynamsoft::dbr::CBarcodeReader::OutputLicenseToString (char content[], const int contentLen)

Parameters
[in,out] content The output string which stores the content of license.
[in] contentLen The length of output string. The recommended length is 512 per license key.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

Remarks
InitLicenseFromServer has to be successfully called before calling this method.

OutputLicenseToStringPtr

Output the license content as an encrypted string from the license server to be used for offline license verification.

int dynamsoft::dbr::CBarcodeReader::OutputLicenseToStringPtr (char** content)

Parameters
[in,out] content The output string which stores the content of license.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

Remarks
InitLicenseFromServer has to be successfully called before calling this method.

FreeLicenseString

Free memory allocated for the license string.

void dynamsoft::dbr::CBarcodeReader::FreeLicenseString (char** content)

Parameters
[in] content The output string which stores the content of license.

Remarks
OutputLicenseToStringPtr has to be successfully called before calling this method.

InitDLSConnectionParameters

Initializes a DM_DLSConnectionParameters struct with default values.

static int dynamsoft::dbr::CBarcodeReader::InitDLSConnectionParameters(DM_DLSConnectionParameters *pDLSConnectionParameters)

Parameters
[in, out] pDLSConnectionParameters The struct of DM_DLSConnectionParameters.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

Code Snippet

DM_DLSConnectionParameters paramters;
dynamsoft::dbr::CBarcodeReader::InitDLSConnectionParameters(&paramters);
paramters.handshakeCode = "Your handshake code";
dynamsoft::dbr::CBarcodeReader::InitLicenseFromDLS(&paramters);

InitLicenseFromDLS

Initializes the barcode reader license and connects to the specified server for online verification.

static int dynamsoft::dbr::CBarcodeReader::InitLicenseFromDLS(DM_DLSConnectionParameters *pDLSConnectionParameters, char errorMsgBuffer[] = NULL, const int errorMsgBufferLen = 0)

Parameters
[in] pDLSConnectionParameters The struct DM_DLSConnectionParameters with customized settings.
[in, out] errorMsgBufferOptional The buffer is allocated by the caller and the recommended length is 256. The error message will be copied to the buffer.
[in] errorMsgBufferLenOptional The length of the allocated buffer.

Return Value
Returns error code (returns 0 if the function operates successfully).
You can call GetErrorString to get detailed error message.

Code Snippet

DM_DLSConnectionParameters paramters;
dynamsoft::dbr::CBarcodeReader::InitDLSConnectionParameters(&paramters);
paramters.handshakeCode = "Your handshake code";
dynamsoft::dbr::CBarcodeReader::InitLicenseFromDLS(&paramters);

GetIdleInstancesCount

Gets available instances count when charging by concurrent instances count.

static int dynamsoft::dbr::CBarcodeReader::GetIdleInstancesCount()

Return Value
Returns available instances count.

Code Snippet

//...
int count = dynamsoft::dbr::CBarcodeReader::GetIdleInstancesCount();
if(count > 0)
{
  //create instance and process further
}
else 
{
  //waiting for available instances 
}

InitLTSConnectionParameters

Deprecated. Use InitDLSConnectionParameters instead.

InitLicenseFromLTS

Deprecated. Use InitLicenseFromDLS instead.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

version 8.9.3

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +