This document is archived and information here might be outdated. Recommended version. |
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
);
[C++]
Parameters UID [in]
UID is a parameter of type IUID*
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)