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


ICommandPool.UID Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IC > ICommandPool Interface > ICommandPool.UID Property
ArcGIS Developer Help

ICommandPool.UID Property

The UID of the given command. May return nothing.

[Visual Basic .NET]
Public Function get_UID ( _
    ByVal Command As ICommand _
) As UID
[C#]
public UID get_UID (
    ICommand Command
);
[C++]
HRESULT get_UID(
  ICommand* Command,
  IUID** pVal
);
[C++]
Parameters
Command [in]

Command is a parameter of type ICommand* pVal [out, retval]
pVal is a parameter of type IUID**

Product Availability

Available with ArcGIS Engine.

Description

Returns the UID of the specified command. The method will return Nothing if the command object has been added to the CommadPool using either the AddCommand or IToolbarControl::AddItem, IToolbarMenu::AddItem or IToolbarPalette::AddItem methods without a UID or ProgID supplied.

Errors Returned

1036 800a040c: The supplied command does not exist in command pool

[C#]

In C# use the get_UID method, as indexed property accessors are not supported.

ICommand command = axToolbarControl1.CommandPool.get_Command(0);
UID uID = new UIDClass();
uID = axToolbarControl1.CommandPool.get_UID(command);
if (uID != null) System.Windows.Forms.MessageBox.Show(uID.Value.ToString());
[Visual Basic .NET]
Dim pCommand As ICommand
pCommand = AxToolbarControl1.CommandPool.Command(0)
Dim pUid As New UIDClass
pUid = AxToolbarControl1.CommandPool.UID(pCommand)
If Not pUid Is Nothing Then System.Windows.Forms.MessageBox.Show(pUid.Value)

See Also

ICommandPool Interface