18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPLICATION DEVELOPMENT AND LICENSE INITIALIZATION<br />

For a detailed description on how to use the<br />

LicenseControl, see Chapter 3, ‘Developing with<br />

<strong>ArcGIS</strong> controls’, and Chapter 6, ‘<strong>Developer</strong><br />

scenarios’.<br />

IAoInitialize<br />

Application AoInitialize<br />

The coclass AoInitialize and the IAoInitialize<br />

and ILicenseInformation interfaces it implements<br />

are designed to give support to a<br />

developer for license initialization.<br />

In this example, even though ArcInfo would also<br />

provide the functionality required, the developer<br />

has opted not to initialize with an ArcInfo<br />

license. It would be unnecessary to consume an<br />

ArcInfo license for this simple application.<br />

Step 1: Check product license<br />

availability<br />

Step 2: Check extension license<br />

availability<br />

LICENSE CONFIGURATION<br />

There are two ways to configure a custom application with a license: using the<br />

LicenseControl and programmatically.<br />

Use the LicenseControl to automatically perform license initialization within<br />

simple graphical user interface applications using the MapControl,<br />

PageLayoutControl, TOCControl, ToolbarControl, ReaderControl, SceneControl,<br />

or GlobeControl in the COM and .NET APIs. If greater control is required over<br />

license initialization, particularly when checking extension licenses in and out (the<br />

LicenseControl will check out extension licenses for the duration of an<br />

application’s life), consider programmatically performing license initialization.<br />

To programmatically perform license initialization use the AoInitialize object and<br />

the IAoInitialize and ILicenseInformation interfaces it implements. The ESRI License<br />

Initializer Visual Basic 6 and Visual Studio .NET add-ins can be used to<br />

automatically generate and add license initialization code to a custom application.<br />

See Appendix B, ‘<strong>ArcGIS</strong> developer resources’, for further information about the<br />

add-ins or the licensing samples found in<br />

\<strong>Developer</strong>Kit\Samples\Licensing_and_Extension_Checking.<br />

EXAMPLE A—MINIMUM LICENSE IS ARCGIS ENGINE WITH 3D AND<br />

SPATIAL EXTENSIONS<br />

In this example, the application requires at minimum an <strong>ArcGIS</strong> <strong>Engine</strong> license.<br />

In addition, this developer has decided that if an <strong>ArcGIS</strong> <strong>Engine</strong> license is not<br />

available, the application could run with an ArcView or ArcEditor license instead.<br />

The application also requires 3D and spatial extension functionality for it<br />

to run successfully, so both of these extensions need to be checked out for the<br />

duration of the application.<br />

In this case, the application will first attempt to initialize against the <strong>ArcGIS</strong><br />

<strong>Engine</strong> product license. If that fails, it will attempt to initialize against an<br />

ArcView license, and if still unsuccessful, the application will finally attempt to<br />

initialize against the ArcEditor product license. The following sections outline the<br />

steps that must be taken to initialize the application with a license.<br />

Attempting initialization with the <strong>ArcGIS</strong> <strong>Engine</strong> product license<br />

As noted above, to run successfully the application requires at minimum an<br />

<strong>ArcGIS</strong> <strong>Engine</strong> product license along with the corresponding 3D and Spatial<br />

extension licenses. The application’s first attempt at initialization should be<br />

against this minimal level of product licensing. The application’s attempts at<br />

initialization follow the process discussed earlier.<br />

1. Check whether an <strong>ArcGIS</strong> <strong>Engine</strong> product license is available. If yes, proceed<br />

to the next step in the initialization process. If not, discontinue this attempt<br />

and restart initialization with any secondary level of allowable product licensing.<br />

2. Determine whether a 3D extension license is available for the <strong>ArcGIS</strong> <strong>Engine</strong><br />

product license.<br />

Chapter 5 • Licensing and deployment • 265

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!