ArcObjects Library Reference (Controls)  

ICommandPoolEdit.CallOnCreate Method

Calls the specified command OnCreate method if the Hook is set and OnCreate has not already been called.

ERROR: Syntax information about ICommandPoolEdit.CallOnCreate may not be in D:\ArcGIS\DotNet\ESRI.ArcGIS.Controls.dll

[C++]
HRESULT CallOnCreate(
  ICommand* pCommand
);
[C++]

Parameters

pCommand [in]

  pCommand is a parameter of type ICommand

Product Availability

Available with ArcGIS Engine.

Description

Calls the ICommand:OnCreate event for the specified command.

When a command is added to the CommandPool, the ICommandPool::Created property is set to false. If the ICommandPoolEdit::Hook property is set, the CallOnCreate method will pass the Hook into the command's ICommand:OnCreate method. The ICommandPool::Created property is then set to true.

To ensure that the ICommand:OnCreate method is called only once during the lifetime of the command object, subsquent calls to the CallOnCreate method will not do anything.

Errors Returned

1048 800a0418: The hook has not yet been set into the CommandPool
1036 800a040c: The supplied command does not exist in command pool

See Also

ICommandPoolEdit Interface