> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetCurrentLicense Method of the Engine Object

This method sets the current license.

> [!WARNING]
>
> All the ABBYY FlexiCapture SDK objects which were in use before this method call become invalid (except the current [**Engine**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine.md) object and the [**License**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/license.md) object, which was passed to this method). The only thing that you can do with these objects is to call **Release** method for them.

## Syntax

```vb Visual Basic .NET theme={null}
Sub SetCurrentLicense( _
  TargetLicense As License, _
  CustomerProjectId As String _
)
```

```cpp C++ theme={null}
HRESULT SetCurrentLicense(
  ILicense* TargetLicense,
  BSTR      CustomerProjectId
);
```

## Parameters

**TargetLicense**

\[in] This parameter refers to the [**License**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/license.md) object representing the license. Any object from the [**IEngine::Licenses**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine.md#licenses) collection can be passed to this parameter.

**CustomerProjectId**

\[in] This variable contains Customer Project ID number that matches the necessary license. Customer Project ID is an alphanumeric string shared by all the Developer and Runtime licenses in one project.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## See also

[**Engine**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine.md)
