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


IExtensionManagerAdmin.AddExtension Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (System)  

IExtensionManagerAdmin.AddExtension Method

Creates a single extension given the CLSID, then passes initializationData to IExtension::Startup.

[Visual Basic .NET]
Public Sub AddExtension ( _
    ByVal ExtensionCLSID As UID, _
    ByRef initializationData As Object _
)
[C#]
public void AddExtension (
    UID ExtensionCLSID,
    ref object initializationData
);
[C++]
HRESULT AddExtension(
  IUID* ExtensionCLSID,
  VARIANT* initializationData
);
[C++]

Parameters ExtensionCLSID [in]
ExtensionCLSID is a parameter of type IUID initializationData [in] initializationData is a parameter of type VARIANT

Product Availability

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

Description

The AddExtension method loads the extension specified by the CLSID. Before using a licensed extension, it needs to be loaded and enabled.

extensionCLSID specifies the unique identifier (UID) of an extension.

To enable the extension, find the extension using the IExtensionManager::FindExtension method, obtain IExtensionConfig on the extension, and then set the State property to esriESEnabled.

To load all the extension within a specified component category  (for example, ESRI Mx Extensions) use the StartipExtensions method.

Remarks

COM coclasses are identified by a globally unique identifier (GUID). There two formats for the GUID for a coclass: a class ID (CLSID) and a ProgID. The ProgID is a text alias for a CLSID. The UID coclass can be used to represent the GUID of an extension object. You can set the IUID.Value property to either the CLSID or the ProgID.

To find the CLSID and ProgID of an ESRI extension, refer to the following technical document:

ArcObjects Developer Help > Technical Documents > ESRI Extensions: Names and IDs

For your custom extensions, the ProgID is a string composed of the name of your project used to make the extension and the class name of the extension.

See Also

IExtensionManagerAdmin Interface