This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IC > ICommandPool Interface > ICommandPool.FindByUID Method (ArcObjects .NET 10.4 SDK) |
Searches the command pool for the given UID. Returns matching command if the UID is found or nothing.
[Visual Basic .NET] Public Function FindByUID ( _ ByVal UID As UID _ ) As ICommand
[C#] public ICommand FindByUID ( UID UID );
[C++]
HRESULT FindByUID(
IUID* UID,
ICommand** pCommand
);
[C++]
Parameters UID [in]
UID is a parameter of type IUID pCommand [out, retval]
pCommand is a parameter of type ICommand
Searches the CommandPool for the specified UID, and returns the matching Command. Returns Nothing if the UID cannot be found. For commands that implement ICommandSubType, the IUID::SubType must be specified, otherwise Nothing will be returned.
1034 800a040a: The supplied command is invalid
UID uID=new UIDClass();
uID.Value="MyCommandSubTypes.MyCommands";
uID.SubType=2;
ICommand command=axToolbarControl1.CommandPool.FindByUID(uID);
if (command != null) System.Windows.Forms.MessageBox.Show(command.Name);
Dim pUid As New UIDClass
pUid.Value="MyCommandSubTypes.MyCommands"
pUid.SubType=2
Dim pCommand As ICommand
pCommand=AxToolbarControl1.CommandPool.FindByUID(pUid)
If Not pCommand Is Nothing Then System.Windows.Forms.MessageBox.Show (pCommand.Name)