ArcObjects Library Reference (Controls)  

IToolbarControl2.CommandPool Property

The command pool used by the ToolbarControl to manage command objects. The command pool object maybe shared with other ToolbarControls and ToolbarMenus.

[Visual Basic .NET]
Public Property CommandPool As ICommandPool
[C#]
public ICommandPool CommandPool {get; set;}
[C++]
HRESULT get_CommandPool(
  ICommandPool** pVal
);
[C++]
HRESULT putref_CommandPool(
  ICommandPool* pVal
);
[C++]

Parameters

pVal [out, retval]

  pVal is a parameter of type ICommandPool

pVal [in]

  pVal is a parameter of type ICommandPool

Product Availability

Available with ArcGIS Engine.

Description

The CommandPool manages the collection of commands used by the ToolbarControl. The AddItem, AddToolbarDef, Remove and RemoveAll methods all use the CommandPool.

Care must be taken by developers when using the CommandPool to ensure that the ICommandPool::UsageCount of any commands in the collection stay synchronised with the number of item's using the command as the IToolbarItem::Command.

Note that if a new CommandPool is set commands are copied from the original CommandPool into the new one. If the same command exists in the original CommadPool and the new CommandPool, the command in the new CommandPool is used.

Errors Returned

1034 800a040a: The supplied command is invalid
1046 800A0416: The supplied command pool object is invalid

See Also

IToolbarControl2 Interface