# ILicenses

Description:

`ILicenses` is a collection for managing licenses.
```cpp
import "OxSvrSpt.idl"
```
Public Methods:
```cpp
HRESULT Add ([in] BSTR Name)
HRESULT Delete ([in] VARIANT Index)
HRESULT Clear ()
HRESULT Check ([in] BSTR Name)
```
Properties:
```cpp
long Count [get]
BSTR Item([in] VARIANT Index) [get]
```
Documentation of Element Functions:

* `HRESULT Add ([in] BSTR Name)`

[abn.Add](../abn.md#abn.Add) adds a new license string.

If you try to add a license string twice, the second one is ignored. No error is generated. The passed license string is converted to uppercase and managed internally.

Parameters:

: `Name` license string to be added

* `HRESULT Check ([in] BSTR Name)`

`Check` verifies the specified license with the server without checking it in via [lic.LicLogin](../lic.md#lic.LicLogin).

This method works via the server job " [lic.CheckLicense](../lic.md#lic.CheckLicense) "

If the verification fails, the topmost error of the error collection is returned as a COM error.

Parameters:

: `Name` the license to be verified

* `HRESULT Clear ()`

`Clear` removes all elements from the collection.

* `HRESULT Delete ([in] VARIANT Index)`

`Delete` deletes the license entry based on position in the list or name.

Parameters:

: `Index` name or position of the license entry to be deleted

Documentation of Properties:

* `long Count [get]`

`Count` returns the number of elements in the collection.

Parameters:

: `plNumber` (VB return value) number of elements in the collection

* `BSTR Item([in] VARIANT Index) [get]`

`Item` returns the specified element of the collection based on position or key.

If a position outside the valid index is specified, an error with the error value `errCollectionIndexOutOfRange` is returned. If the item cannot be found, an error with the value `errCollectionItemNotFound` is returned.

Parameters:

: `Index` position or name of the requested element

: `pItem` (VB return value) corresponding license that matches the key
