Licensing Development Kit Interface
The interface to the LDK is shown below:
|
Copy Code |
interface IDeploymentComponent : IDispatch
{
[propget, id(1)] HRESULT LicKey ( [out, retval] BSTR* pVal );
[propput, id(1)] HRESULT LicKey ( [in] BSTR newVal );
[propget, id(2)] HRESULT srvURL ( [out, retval] BSTR* pVal );
[propput, id(2)] HRESULT srvURL ( [in] BSTR newVal );
[propget, id(3)] HRESULT ConfigPath ( [out, retval] BSTR* pVal );
[propput, id(3)] HRESULT ConfigPath ( [in] BSTR newVal );
[propget, id(4)] HRESULT ResultString ( [out, retval] BSTR* pVal );
[propget, id(5)] HRESULT ResultCode ( [out, retval] enumLdkErrorCodes* pVal );
[id(6)] HRESULT GetLicKeyAuto ( [in] BSTR accKey );
[id(7)] HRESULT GetHdwKey ( [in] BSTR accKey
, [out,retval] BSTR* hdwKey );
[id(8)] HRESULT StartEvalPeriod ( void );
[id(10)] HRESULT GetEvalPeriod ( [out, retval] long* pVal );
}; |
LDK Properties
- LicKey - Stores the License Key to the registry when it is set, and reads it from the registry during the get operation.
- srvURL - Gets and sets the URL path to the licensing web service. The default is the URL path to Accusoft's Deployment Licensing Service.
- ConfigPath - Gets and sets a path to the deployment configuration file. Multiple products can be registered at one time by setting the filenames as a semicolon-delimited list: e.g., "c:\config.txt;c:\config2.txt".
- ResultString - Contains the string descriptions of any error that may have occurred during the last operation.
- ResultCode - Can be used to contain any of the error codes described in Licensing Component Error Codes and Messages.
LDK Methods
- GetLicKeyAuto: Obtains a License Key for the end user's system using the automatic (or connected) scenario. It takes an Access Key as its input parameter, and stores the obtained license key in the registry. If you choose not to distribute individual Access Keys, the accKey argument should be an empty string.
- GetHdwKey: Obtains a hardware key from the current machine and returns it (as hdwKey). If you choose not to distribute individual access keys, the accKey argument should be an empty string.
- StartEvalPeriod: Sets an evaluation licensing mode for the product and starts an evaluation period. This method is provided so you can distribute an evaluation version of your application, without having to distribute Access Keys to people who would like to evaluate your software. Using this method you can license Accusoft components on the end user's system for a limited time - the default is 30 days, but it can be customized per request to Accusoft. If the evaluators purchase your software, you can then issue them an access key using either the automatic or manual scenarios to obtain permanent component licenses, just as Accusoft does for its evaluators.
- GetEvalPeriod: Obtains the remaining time on an evaluation (in days). It returns EvalPeriod < 0 if the evaluation period is expired.