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


ICommandPoolEdit.Remove Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Controls)  

ICommandPoolEdit.Remove Method

Decrements the usage count of the command. If this reaches zero the command is removed from the command pool.

[Visual Basic .NET]
Public Sub Remove ( _
    ByVal Command As ICommand _
)
[C#]
public void Remove (
    ICommand Command
);
[C++]
HRESULT Remove(
  ICommand* Command
);
[C++]

Parameters Command [in]
Command is a parameter of type ICommand

Product Availability

Available with ArcGIS Engine.

Description

Decrements the supplied command UsageCount by 1. If the UsageCount reaches 0 the command is released from the CommandPool and the ICommandPool::Exists property will return false. If the UsageCount is 1 or more the command will remain in the CommandPool. The number of calls to the AddUID and AddCommand methods for a given UID must typically match the number of calls to Remove.

Errors Returned

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

Remarks

Typically the ToolbarControl will manage the commands in the CommandPool as part of IToolbarControl::AddItem and IToolbarControl::Remove methods.

See Also

ICommandPoolEdit Interface