> ## 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.

# Engine オブジェクトの SetCurrentLicense メソッド

このメソッドは、現在のライセンスを設定します。

> [!WARNING]
>
> このメソッドを呼び出す前に使用していた ABBYY FlexiCapture SDK のオブジェクトは、すべて無効になります (ただし、現在の [**Engine**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine.md) オブジェクトと、このメソッドに渡した [**License**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/license.md) オブジェクトは除きます) 。無効になったオブジェクトに対しては、**Release** メソッドの呼び出し以外の操作はできません。

## 構文

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

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

## パラメーター

**TargetLicense**

\[in] このパラメーターは、ライセンスを表す [**License**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/license.md) オブジェクトを参照します。このパラメーターには、[**IEngine::Licenses**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine.md#licenses) コレクション内の任意のオブジェクトを渡すことができます。

**CustomerProjectId**

\[in] この変数には、対象のライセンスに対応する顧客プロジェクトID番号が格納されます。顧客プロジェクトIDは英数字からなる文字列で、1 つのプロジェクト内のすべての開発者ライセンスおよびランタイムライセンスに共通です。

## 戻り値

このメソッドには固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## 関連項目

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