Resource Base
Table of contents
Notice: This documentation is archived. For the latest product features and documentation, please visit Dynamsoft Capture Vision Documentation.

CLicenseManager Class

class dynamsoft::core::CLicenseManager 
Method Description
GetIdleInstancesCount Gets available instances count when charging by concurrent instances count.
InitLicense Sets the license key and activates the SDK.

GetIdleInstancesCount

Gets available instances count when charging by concurrent instances count.

static int dynamsoft::core::CLicenseManager::GetIdleInstancesCount()

Return Value

Returns available instances count.

  • 0: There is no space for new instance
  • -1: The available count needs to be updated from server by calling InitLicense.
  • N ( N > 0 ): N more instances can be created.

Code Snippet

//...
int count = dynamsoft::core::CLicenseManager::GetIdleInstancesCount();
if(count > 0)
{
  //create instance and process further
}
if(count < 0)
{
  //call InitLicense
  //create instance and process further
}
if(count = 0)
{
  //waiting for available instances 
}

InitLicense

Sets the license key and activates the SDK.

static int dynamsoft::core::CLicenseManager::InitLicense(const char *license, char errorMsgBuffer[], const int errorMsgBufferLen) 

Parameters

[in] pLicense The license key.

[in, out] errorMsgBuffer The buffer is allocated by caller and the recommended length is 256. The error message will be copied to the buffer.

[in] errorMsgBufferLen The length of the allocated buffer.

Return Value

Returns error code (returns 0 if the function operates successfully).

Code Snippet

int errorCode = 0;
char szErrorMsg[256];
errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", szErrorMsg, 256);
if (errorCode != DM_OK)
    cout << szErrorMsg << endl;

Is this page helpful?

YesYes NoNo

In this article:

Version 2.4.10

    • version 2.4.10
    • Version 2.x
      • Version 2.2.10
      • Version 2.2.0
      • Version 2.0.20
      • Version 2.0.10
      • Version 2.0.0
    • Version 1.x
      • Version 1.0.20
      • Version 1.0.10
      • Version 1.0.0
    Change +