This document is archived and information here might be outdated. Recommended version. |
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(
void
);
[C++]
HRESULT putref_CommandPool(
);
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.
1034 800a040a: The supplied command is invalid
1046 800A0416: The supplied command pool object is invalid