Check out an extension.
[Visual Basic .NET] Public Function CheckOutExtension ( _ ByVal extensionCode As esriLicenseExtensionCode _ ) As esriLicenseStatus
[C#] public esriLicenseStatus CheckOutExtension ( esriLicenseExtensionCode extensionCode );
[C++]
HRESULT CheckOutExtension(
esriLicenseExtensionCode extensionCode,
esriLicenseStatus* licenseStatus
);
[C++]Parameters
extensionCode [in]extensionCode is a parameter of type esriLicenseExtensionCode
licenseStatus [out, retval]licenseStatus is a parameter of type esriLicenseStatus
Product Availability
Description
Checks out the specified extension license. Extensions can either be checked out as and when an application requires the extension functionality, and checked in once the application has finished with the functionality; or the extension can be checked out directly after the application is initialized and checked back in before Shutdown. Use the CheckInExtension method to check extensions back in. The way that the extensions are checked in and out will depend on the type of product license passed to the Initialize method.
- If the application was initialized with either of the Engine Single Use licenses, any extensions used by the application will also be Engine Single Use. As such, any extensions can be checked out directly after the application is initialized and checked back in before Shutdown.
- If the application was initialized with a license server and the extensions are required by the application for it to run successfully, the extensions should be checked out directly after the application is initialized and checked back in before Shutdown.
- If the application was initialized with a license server and the extension functionality is not necessary for the application to function, the extensions can either be checked out directly after the application is initialized or checked out as and when the extension functionality is required. When the extension is checked in, the functionality should be disabled. Use the IsExtensionCheckedOut method to determine whether the extension is already checked out.
Using the CheckOutExtension method to check out an extension in an ArcGIS for Desktop application will not enable the user interface objects in the extension. Use the IExtension object to access the extension functionality and limit the use of the AoInitialize object to testing the availability of extension licenses and determining the extensions already checked out.
Remarks
If an application using extension functionality is initialized with an Engine single use license (ArcGIS Engine or ArcGIS Engine with Enterprise GeoDatabase) the extension license may automatically get checked out. This is because Engine single use licenses are not reference counted. It is highly recommended that extension licenses are always explicitly checked out using the CheckOutExtension method to support deployment of the application in both an environment that uses an Engine single use license and an environment that uses a license server (desktop single use or desktop concurrent licenses).
The CheckOutExtension method will fail to check out the specified extension license if:
- the extension is not licensed.
- the license is unavailable because it is already being used. An extension may fail to check out because it may have been checked out by another application since the IsExtensionCodeAvailable method checked its availability. (Desktop Concurrent licenses only).
- an unexpected license failure occurs due to system administration problems.
- the license is already checked out. Use the IsExtensionCheckedOut method to determine this.