This document is archived and information here might be outdated.  Recommended version.


IAoInitialize.Initialize Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (System)  

IAoInitialize.Initialize Method

This must be called before any other ArcObjects are created to initialize product Code. If called a second time during the life time of an executable with a new product code, it will return esriLicenseAlreadyInitialized.

[Visual Basic .NET]
Public Function Initialize ( _
    ByVal ProductCode As esriLicenseProductCode _
) As esriLicenseStatus
[C#]
public esriLicenseStatus Initialize (
    esriLicenseProductCode ProductCode
);
[C++]
HRESULT Initialize(
  esriLicenseProductCode ProductCode,
  esriLicenseStatus* licenseStatus
);
[C++]

Parameters ProductCode [in]
ProductCode is a parameter of type esriLicenseProductCode licenseStatus [out, retval]
licenseStatus is a parameter of type esriLicenseStatus

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Initializes the appliction with the specified product license. The product license determines the functionality the application will be able to access. Once the product license has been initialized it cannot be changed for the duration of the applications life, as it is not possible to re-initialize the applicaiton.

Before initializing the application use the IsProductCodeAvailable and IsExtensionCodeAvailable methods to ensure the appropriate license(s) is available to Initialize the application with. If all the licenses you require are available using Engine Single Use then we recommend you use it in preference to the Desktop Concurrent and Desktop Single Use licenses. This means you will not limit the Desktop Concurrent licenses available to any other users.

Remarks

The Initialize method will fail to check out the specified product license if:

Note that loading data into the MapControl or PageLayoutControl through the property pages will automatically initialize the application with a product license. To ensure that the application is initialized with the product license specified by the Initialize method load data into the MapControl and PageLayoutControl programmatically after license initialization.

See Also

IAoInitialize Interface

.NET Snippets

Check Out Extension License